Skip to content

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

Merged
merged 3 commits into from
Aug 7, 2014
Merged

Fix code examples in README #28

merged 3 commits into from
Aug 7, 2014

Conversation

fhemberger
Copy link
Contributor

  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).

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).
@yahoocla
Copy link

CLA is valid!

@fhemberger
Copy link
Contributor Author

(Note: Build failed because of #27)

@fhemberger
Copy link
Contributor Author

Any chance to get this merged?

@caridy
Copy link
Collaborator

caridy commented Jul 5, 2014

@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>';
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes, ok.

@fhemberger
Copy link
Contributor Author

Well, the review has been done a month ago. Can it be merged?
It really just fixes typos and little inaccuracies in your README that will help people to get started using your helper.

@drewfish
Copy link
Contributor

drewfish commented Aug 7, 2014

Sorry, yeah it looks good. +1

@caridy
Copy link
Collaborator

caridy commented Aug 7, 2014

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.

caridy added a commit to caridy/dust-helper-intl that referenced this pull request Aug 7, 2014
@caridy
Copy link
Collaborator

caridy commented Aug 7, 2014

@caridy caridy merged commit 35e130d into formatjs:master Aug 7, 2014
@fhemberger
Copy link
Contributor Author

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants