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

Improve docs, explain [.] #49

Closed
ghost opened this issue May 11, 2015 · 4 comments
Closed

Improve docs, explain [.] #49

ghost opened this issue May 11, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented May 11, 2015

I'm not sure what [.] does vs .

numbro.setDefaultCurrencyFormat('0,0.00');
vs
numbro.setDefaultCurrencyFormat('0,0[.]00');

Does [.] make the decimal optional? For example 8.00 would be $8 not $8.00. but 8.1 would be $8.10

@BenjaminVanRyseghem
Copy link
Owner

Exactly

numbro(12).format('0.00') // 12.00
numbro(12).format('0[.]00') // 12

numbro(12.34).format('0.00') // 12.34
numbro(12).34.format('0[.]00') // 12.34

@homer2
Copy link

homer2 commented May 29, 2015

Is there a format to remove insignificant trailing zeros?

numbro(12.34).format('0[.]0?') // 12.34
numbro(12.30).format('0[.]0?') // 12.3

@BenjaminVanRyseghem
Copy link
Owner

Not that I am aware of 😄

Could you report it in a separate entry?

Thanks

@BenjaminVanRyseghem
Copy link
Owner

I close this issue as the separate issue reported here looks similar to #68

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