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

Behaviour for '#' and '0' #37

Open
manojchandrashekar opened this issue Aug 14, 2019 · 0 comments
Open

Behaviour for '#' and '0' #37

manojchandrashekar opened this issue Aug 14, 2019 · 0 comments

Comments

@manojchandrashekar
Copy link

The patterns do not behave as expected? When using #, the number should not substitute a 0 in the price, unless it is used with #0

This is correct:

OSREC.CurrencyFormatter.format(0.45, {pattern: "#,##0.## !"})

>> "0.45 $"

Incorrect (?):

OSREC.CurrencyFormatter.format(0.45, {pattern: "#,##.## !"})

>> "0.45 $"

Expected:

>> ".45 $"

Incorrect (?):

OSREC.CurrencyFormatter.format(120, {pattern: "#,##0.##00 !"})

>> "120.0000 $"

Expected:

>> "120.00 $"

Incorrect (?):

OSREC.CurrencyFormatter.format(120, {pattern: "#,##0.## !"})

>> "120.00 $"

Expected:

>> "120 $"

Is this not what was planned for the patterns?

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

1 participant