Last active
August 29, 2015 14:05
-
-
Save rxaviers/84656fecf4127b577a11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Globalize = require( "globalize" ); | |
Globalize.load( require( "./likelySubtags.json" ) ); | |
Globalize.load( require( "./sv-numbers.json" ) ); | |
var sv = Globalize( "sv" ); | |
sv.formatNumber( 123456.78 ); // 123 456,78 | |
sv.parseNumber( "123 456,78" ); // 123456.78. obs: copying pasting the above result. | |
sv.parseNumber( sv.formatNumber( 123456.78 ) ); // 123456.78 | |
sv.parseNumber( "123 456,78" ); // NaN. obs: typing space myself. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment