Ejemplo n.º 1
0
function standardize_amount($amount)
{
    $CI =& get_instance();
    $thousands_separator = format_thousands_separator($CI->mdl_settings->setting('thousands_separator'));
    $decimal_point = $CI->mdl_settings->setting('decimal_point');
    $amount = str_replace($thousands_separator, '', $amount);
    $amount = str_replace($decimal_point, '.', $amount);
    return $amount;
}
 public function testFormatThousandsSeparator()
 {
     $this->assertEquals(format_thousands_separator('.'), '.', 'The separator is not the same');
     $this->assertEquals(format_thousands_separator(','), ',', 'The separator is not the same');
     $this->assertEquals(format_thousands_separator('  '), ' ', 'The space (spaces) separator is not the " "');
 }