Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatter_utils.dart - toCurrencyString not consistent when deducting/using separators #108

Closed
igor00krnic opened this issue Dec 6, 2022 · 2 comments

Comments

@igor00krnic
Copy link

Please consider the code below.
Int 1234 is formatted like '1.234', when given back to this method the result should remain the same, but the actual result is '1'.

toCurrencyString(
  '1.234',
  thousandSeparator: ThousandSeparator.Period,
  mantissaLength: 0,
);

I think that I see a couple of problems in this example:
2. When splitting the string to even and fractional part it uses the hardcoded '.' separator. Should it use the separators deduced at the beginning of the mehod (mSeparator, tSeparator)?
3. I think that the fractionalSeparator variable is wrongly deduced. What is the use case of this separator?

@caseyryan
Copy link
Owner

Yeah, that's weird. I'll take a look into it

@caseyryan
Copy link
Owner

Fixed in 2.9.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants