About 52 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. Javascript String to int conversion - Stack Overflow

    12 This is to do with JavaScript's + in operator - if a number and a string are "added" up, the number is converted into a string:

  3. 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, …

  4. 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;

  5. html - Javascript string/integer comparisons - Stack Overflow

    Mar 23, 2016 · Javascript string/integer comparisons Asked 14 years, 10 months ago Modified 3 years, 5 months ago Viewed 214k times

  6. How to convert String variable to int in javascript?

    Aug 20, 2012 · What is the correct way to convert value of String variable to int/numeric variable? Why is bcInt still string and why does isNaN return true? bc=localStorage.getItem('bc'); var …

  7. how to parse string to int in javascript - Stack Overflow

    Nov 16, 2010 · i want int from string in javascript how i can get them from test1 , stsfdf233, fdfk323, are anyone show me the method to get the integer from this string. it is a rule that int …

  8. How can I check if a string is a valid number? - Stack Overflow

    In JavaScript, it's not always as straightforward as it should be to reliably check if a value is a number. It's common for devs to use +, -, or Number () to cast a string value to a number (for …

  9. JavaScript convert int to String - Stack Overflow

    Apr 8, 2014 · JavaScript convert int to String Asked 11 years, 10 months ago Modified 11 years, 10 months ago Viewed 8k times

  10. How to check if a variable is an integer in JavaScript?

    Feb 1, 2013 · What do you mean? This checks for data types in javascript, "1.0" is a string, and is therefore not a number. Otherwise 1 will be the value of a variable if you set it thusly var …