-
Notifications
You must be signed in to change notification settings - Fork 11
Fix code examples in README #28
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
Conversation
1. Change variable name in example from 'dateString' to 'dateStr' to match other occurrences 2. Dust helper parameters (like locale or currency identifiers) must be passed as strings. Numeric values like 40000.004 should be passed as strings as well, otherwise decimals with leading zeros get truncated (e.g. 40000.4).
CLA is valid! |
(Note: Build failed because of #27) |
Any chance to get this merged? |
@clarle @juandopazo @drewfish can you guys revisit this? |
@@ -127,7 +138,7 @@ Output: | |||
Template: | |||
|
|||
```js | |||
var tmpl = '<b>{@intlNumber val=40000.004 /}</b>'; | |||
var tmpl = '<b>{@intlNumber val="40000.004" /}</b>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the numbers need to be quoted? This seems to be contrary to the approach we suggest for intlDate where the unquoted unixtime is suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integers don't need to be quoted, floats have to. Otherwise Intl will convert this example to 40000.4
. You can test it here: http://jsbin.com/gezupene/1/
Of cause, this case wouldn't normally occur when you pass in a variable directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, ok.
Well, the review has been done a month ago. Can it be merged? |
Sorry, yeah it looks good. +1 |
the failing unit test is probably an issue with intl after making the default month to be long instead of short to align with browsers, I can fix that. |
Thanks! |
other occurrences
as strings. Numeric values like 40000.004 should be passed as strings as
well, otherwise decimals with leading zeros get truncated (e.g. 40000.4).