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(",", "."));
Answer from Jesse Rusak on Stack Overflow
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Data_structures
JavaScript data types and data structures - JavaScript | MDN
It is also the only value in JavaScript that is not equal to itself. Although a number is conceptually a "mathematical value" and is always implicitly floating-point-encoded, JavaScript provides bitwise operators. When applying bitwise operators, the number is first converted to a 32-bit integer.
Discussions

Converting a string to a float in Javascript?
+"3.4" => 3.4 More on reddit.com
🌐 r/javascript
15
0
March 27, 2015
Convert string to Float
Hello Everyone! I didn’t find such topic. So I decide to to set up a topic. I couldn’t find at script manual the function to convert string to float. I tried to use the Python function a = "52525238,27337273,83495772" float(a) or int(a) but it didn’t work. Can somebody help me with this? More on forum.universal-robots.com
🌐 forum.universal-robots.com
0
June 9, 2017
What is the fastest way to convert string to float out of these 13 methods?
Well most of those won't cast to a float as they're bitwise operations. But in general, use parseFloat. Don't prematurely optimise. More on reddit.com
🌐 r/javascript
7
0
February 12, 2018
Library/function that will tidy up weird JS float values without converting to string in between?
If precision is important, then just use integers for everything and convert to floats only at the end for the UI; if you want to round to a specific precision then just multiply your floats into ints, round, and then divide back down again: function round(number, precision = 1){ return Math.round( number * Math.pow(10, precision) ) / Math.pow(10, precision); } // with int rounding round(0.2 + 0.1); // 0.3 // without int rounding // 0.2 + 0.1 = 0.30000000000000004 More on reddit.com
🌐 r/learnjavascript
11
0
July 13, 2024
🌐
freeCodeCamp
freecodecamp.org › news › how-to-convert-a-string-to-a-number-in-javascript
How to Convert a String to a Number in JavaScript
May 2, 2022 - We can also use the unary plus operator (+) to convert a string into a floating point number.
🌐
W3Schools
w3schools.com › jsref › jsref_parsefloat.asp
JavaScript parseFloat() Method
The parseFloat() method parses a value as a string and returns the first number. If the first character cannot be converted, NaN is returned. Leading and trailing spaces are ignored.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › javascript tutorial › javascript string to float
JavaScript String to Float | Two Methods to Convert String to Float
March 27, 2023 - This method uses the JavaScript Type Conversion function to convert the string type to float.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Udemy
blog.udemy.com › home › javascript parsefloat: a simple way to convert strings into floating point numbers
JavaScript parseFloat: a simple way to convert strings into floating point numbers - Udemy Blog
December 4, 2019 - Here the web page prompts the user to enter a string in the text box and uses parseFloat to parse it and returns the result as a floating number. var num1 = prompt(“enter a number”) var answer = parseFloat(num1) Alert(“the number you entered is:” + answer) Now, let me explain the code. var in JavaScript means a variable.
Find elsewhere
🌐
Favtutor
favtutor.com › articles › convert-string-to-float-javascript
Convert String to Float in JavaScript (5 Easy Ways)
November 30, 2023 - Understand how to do conversion of string to float in javascript using parseFloat, unary plus operator, number() function etc.
🌐
Flexiple
flexiple.com › javascript › string-to-number
How to Convert a String to a Number In JavaScript - Flexiple
June 6, 2024 - To convert a string to a number in JavaScript, you can use the parseFloat() function. This function parses a string argument and returns a floating point number.
🌐
TutorialKart
tutorialkart.com › javascript › javascript-convert-string-to-float
How to convert String to Float in JavaScript?
September 23, 2021 - To convert a string to float in JavaScript, call parseFloat() function and pass the string as argument to it.
🌐
TypeScript
typescriptlang.org › docs › handbook › 2 › everyday-types.html
TypeScript: Documentation - Everyday Types
string represents string values like "Hello, world" number is for numbers like 42. JavaScript does not have a special runtime value for integers, so there’s no equivalent to int or float - everything is simply number
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-program-to-convert-float-to-string
JavaScript Program to Convert Float to String - GeeksforGeeks
August 5, 2025 - ... String(num) converts the float num into a string. This method is simple and widely supported for basic type conversion. Every JavaScript object has the toString() method, which returns a string representing the object.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-parse-float-with-two-decimal-places-in-javascript
How to Parse Float with Two Decimal Places in JavaScript? - GeeksforGeeks
JavaScript provides an inbuilt parseFloat() method to parse a string and returns a floating-point number. Below are the approaches to parse float to two decimal places in JavaScript: ... The parseFloat() method converts a string to a floating-point ...
Published   July 23, 2025
🌐
Reddit
reddit.com › r/javascript › converting a string to a float in javascript?
r/javascript on Reddit: Converting a string to a float in Javascript?
March 27, 2015 -

I can't use parseFloat(). I am so far doing the obvious by checking each character, but I feel there has to be a more elegant way! My function needs to act exactly the same as parseFloat() does. Can anyone help?

🌐
Medium
habtesoft.medium.com › convert-a-string-to-a-number-in-javascript-73b7b32fc622
Convert a string to a number in JavaScript | by habtesoft | Medium
October 18, 2024 - The parseFloat() function is used to parse a string and return a floating-point number. It works in a similar way to parseInt(), but can handle decimals. Here’s an example of using parseFloat() to convert a string to a number:
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-convert-string-to-float
How to Convert String to Float in Python: Complete Guide with Examples | DigitalOcean
July 10, 2025 - Learn how to convert strings to floats in Python using float(). Includes syntax, examples, error handling tips, and real-world use cases for data parsing.
🌐
Universal Robots Forum
forum.universal-robots.com › technical questions › urscript
Convert string to Float - URScript - Universal Robots Forum
June 9, 2017 - Hello Everyone! I didn't find such topic. So I decide to to set up a topic. I couldn't find at script manual the function to convert string to float. I tried to use the Python function a = "52525238,27337273,83495772…
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › parseFloat
Number.parseFloat() - JavaScript | MDN
The Number.parseFloat() static method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns NaN.
🌐
Vultr Docs
docs.vultr.com › javascript › global › parseFloat
JavaScript parseFloat() - Parse String to Float | Vultr Docs
November 6, 2024 - The parseFloat() function in JavaScript is a invaluable tool for transforming string data into float numbers, significantly aiding in calculations and data processing. It efficiently handles a variety of string formats including those with ...
🌐
Dead Simple Chat
deadsimplechat.com › blog › 5-ways-to-convert-string-to-a-number-in-javascript
5 Ways to Convert String to a Number in JavaScript
July 6, 2024 - value: The value that needs to be converted into a numberic type. This value can be Boolean, String or an Object · The number() function returns a primitive value converted or a integer or a floating point number.