HcpShadow / jquery-numberformatter

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

numberString.indexOf is not a function #62

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. call $.parseNumber(tmp, { format: numformattxt }); when tmp = '1', 
numformattxt = "#,###.00" on OnDocumentReady
2. got error "numberString.indexOf is not a function" 
jquery.numberformatter-1.2.3.js (line 442)

What is the expected output? What do you see instead?

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

Please provide any additional information below.
Test on Firefox 11.0, Firebug 1.9.1, jquery-1.4.4.min.js

Original issue reported on code.google.com by minkb...@gmail.com on 5 May 2012 at 7:36

GoogleCodeExporter commented 8 years ago
I added this line before 442 and I worked for me.

if (numberString.constructor === Number) numberString = numberString.toString();

so

if (numberString.constructor === Number) numberString = numberString.toString();

// now we need to convert it into a number
while (numberString.indexOf(group)>-1)

Original comment by minkb...@gmail.com on 5 May 2012 at 7:53

GoogleCodeExporter commented 8 years ago
ref: 
http://stackoverflow.com/questions/332422/how-do-i-get-the-name-of-an-objects-ty
pe-in-javascript

Original comment by minkb...@gmail.com on 5 May 2012 at 7:53

GoogleCodeExporter commented 8 years ago
I'm guessing that a string is not being passed to the method in this case but a 
number. I'd have no idea why you would be parsing a number object into a number 
object, this method is string -> number conversion only.

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