About 565,000 results
Open links in new tab
  1. How can I convert a string to an integer in JavaScript?

    There are two main ways to convert a string to a number in JavaScript. One way is to parse it and the other way is to change its type to a Number. All of the tricks in the other answers (e.g., …

  2. What's the fastest way to convert String to Number in JavaScript?

    Oct 12, 2012 · Also, you might consider including string literal floats in the test for general comparison. My guess is that it may change the order in some cases because string to float …

  3. javascript - How to convert a string to number - Stack Overflow

    I can't figure it out how to convert this string 82144251 to a number. Code: var num = "82144251"; If I try the code below the .toFixed () function converts my number back to a string...

  4. Javascript to convert string to number? - Stack Overflow

    20 This question already has answers here: How can I convert a string to an integer in JavaScript? (32 answers)

  5. Javascript: Converting String to Number? - Stack Overflow

    Is there any way to convert a variable from string to number? For example, I have var str = "1"; Can I change it to var str = 1;

  6. javascript - How to convert a string to number in TypeScript?

    Given a string representation of a number, how can I convert it to number type in TypeScript? var numberString: string = "1234"; var numberValue: number = /* what should I do with …

  7. What's the best way to convert a number to a string in JavaScript ...

    None of the answers I see at the moment correctly convert -0 to "-0". Note that -0..toString() might appear to work, but it's working by converting 0 to "0", then applying the minus sign to it, …

  8. JavaScript string and number conversion - Stack Overflow

    Below is a very irritating example of how JavaScript can get you into trouble: If you just try to use parseInt() to convert to number and then add another number to the result it will concatenate …

  9. How to format numbers as currency strings? - Stack Overflow

    This Stack Overflow thread discusses methods to format numbers as currency strings in various programming languages.

  10. convert a JavaScript string variable to decimal/money

    Apr 1, 2020 · How can we convert a JavaScript string variable to decimal? Is there a function such as: parseInt(document.getElementById(amtid4).innerHTML)