locbet / jquery-numberformatter

Automatically exported from code.google.com/p/jquery-numberformatter
0 stars 0 forks source link

{"format":"#,###","locale":"us"} returns 4,100.00 when calling $.formatNumber - should return 4,100 #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
var mileage = "4100";
var options ='{"format":"#,###","locale":"us"}';
var formatedMileage = $.formatNumber(mileage, options);

What is the expected output? What do you see instead?
"4,100"

What version of the product are you using? On what operating system?
jquery.numberformatter-1.2.3.js

Please provide any additional information below.

Original issue reported on code.google.com by jefftsch...@gmail.com on 15 May 2012 at 4:18

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
You can't pass options in that way, they end up as a string, removing the 
incorrect single and double quotes works -

var options = {format:"#,###",locale:"us"};

Original comment by apar...@gmail.com on 18 Oct 2013 at 12:34