vc-platform icon indicating copy to clipboard operation
vc-platform copied to clipboard

Test smart-float and money directives to correctness

Open asvishnyakov opened this issue 7 years ago • 0 comments

Currently used smart-float and money directives may have incorrect behavior. For example, smart-float allow you to use numbers in the following formats:

  • 222,111.000
  • 222.111,000
  • 222,111
  • 222.111

First two numbers will be converted to 222111 (two hundred twenty-two thousand, one hundred eleven), while second two will be converted to 222 + 111/1000 (two hundred twenty-two and one hundred eleven thousandths).

But third example is incorrect in en-US locale (correctly it must be 222111 (two hundred twenty-two thousand, one hundred eleven) because comma is group separator here).

Write tests to check correctness of numbers parsing by smart-float directive.

Also, we have (commented) another implementation of this directive based on angular i18n. Check it's correctness too and if it correct, use instead of current implementation.

asvishnyakov avatar Oct 24 '17 09:10 asvishnyakov