public function FeedsTamperNumberFormatTestCase::test in Feeds Tamper 7
Same name and namespace in other branches
- 6 tests/feeds_tamper_plugins.test \FeedsTamperNumberFormatTestCase::test()
File
- tests/
feeds_tamper_plugins.test, line 807 - Unit tests for feeds tamper plugins.
Class
Code
public function test() {
$settings = array(
'decimals' => '0',
'dec_point' => '.',
'thousands_sep' => ',',
);
$num = '1234.56';
$this
->execute($num, '1,235', $settings);
// French notation.
$settings['decimals'] = '2';
$settings['thousands_sep'] = ' ';
$settings['dec_point'] = ',';
$this
->execute($num, '1 234,56', $settings);
$num = 1234.5678;
$settings['thousands_sep'] = '';
$settings['dec_point'] = '.';
$this
->execute($num, '1234.57', $settings);
}