How to convert International number strings to their number values

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



The JavaScript Number() function does not work correctly. It will not
convert a string that contains a comma to a number. Commas are used as
decimal points in locales outside the U.S. However, the JavaScript Number()
function returns the error "-1.#IND" when you try to use a comma in the
string parameter. Changing the Regional Language settings in the OS to
German does not help. In fact, when JavaScript runs on a German XP OS, it
still gives this error.

How can I convert an international string to a number in JavaScript?

Regards,
Ray White
(719) 488-8697


.



Relevant Pages

  • Re: How to convert International number strings to their number va
    ... format uses a comma, then the Number format should honor that. ... >>The JavaScript Numberfunction does not work correctly. ... >>convert a string that contains a comma to a number. ...
    (microsoft.public.scripting.jscript)
  • Re: Dynamic variable names
    ... In Javascript, being "object" oriented, you can access every element ... For instance knowing that a variable is named foo ... string, If a string, it should gon in between quotes. ... ALSO out of the window object, if a variable belongs to it. ...
    (comp.lang.javascript)
  • Re: Implicit object constructor misinterpretation
    ... In Javascript, being an identifier is a tokenization concept. ... The concept of "string literal" is again a tokenization/parsing ... String literals are sequences of characters flanked by either ...
    (comp.lang.javascript)
  • Re: CDBL Function truncates decimals
    ... Public Function ConvertNumberforSQL (ByVal sValue As String, ... vlDefaultNumber As Double= 0) as Double ... Since the Spanish formatting has a comma, the SQL statement seems to have ...
    (microsoft.public.vb.general.discussion)
  • Re: Encodings of javascript
    ... How does javascript know that the string it is given is encoded using ... How does the string get inserted into the HTML with UTF-8 encoding? ... The DOM API uses the DOMString type, ... If the browser is Open Source, you can UTSL to confirm that. ...
    (comp.lang.javascript)