If they’re meant to be separate values, try this:
var values = "554,20".split(",")
var v1 = parseFloat(values[0])
var v2 = parseFloat(values[1])
If they’re meant to be a single value (like in French, where one-half is written 0,5)
var value = parseFloat("554,20".replace(",", "."));
More Related Contents:
- Why are regular expressions taking the helm in my JavaScript, and how do I insist “this is a string”? [closed]
- XML parsing of a variable string in JavaScript
- Large numbers erroneously rounded in JavaScript
- Get all Attributes from a HTML element with Javascript/jQuery
- Detect which word has been clicked on within a text
- How to deal with floating point number precision in JavaScript?
- How does JavaScript determine the number of digits to produce when formatting floating-point values?
- Safe evaluation of arithmetic expressions in Javascript
- How do I convert String to Number according to locale (opposite of .toLocaleString)?
- Truncate (not round off) decimal numbers in javascript
- JavaScript displaying a float to 2 decimal places
- Date parsing in javascript is different between safari and chrome
- Why does modulus operator return fractional number in javascript?
- Adding to Number.MAX_VALUE
- Nested JSON objects – do I have to use arrays for everything?
- In JavaScript, why does zero divided by zero return NaN, but any other divided by zero return Infinity?
- understanding floating point variables
- Float sum with javascript [duplicate]
- Why does javascript accept commas in if statements?
- javascript FileReader – parsing long file in chunks
- Round a float up to the next integer in javascript
- Is there a reliable way in JavaScript to obtain the number of decimal places of an arbitrary number?
- Lexer written in Javascript? [closed]
- Integers in JavaScript
- parsings strings: extracting words and phrases [JavaScript]
- 1.265 * 10000 = 126499.99999999999? [duplicate]
- How to parse JSON easily?
- JavaScript: Round to a number of decimal places, but strip extra zeros
- How do I stop parseFloat() from stripping zeroes to right of decimal
- Is there any JavaScript standard API to parse to number according to locale?