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
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 float to string with at least one decimal place (javascript) - Stack Overflow
Let me give you an example. var a = 2.0; var stringA = "" + a; I will get: stringA = "2", but I want: stringA = "2.0". I don't want to lose precision however, so if: var b = 2.412; var stringB =... More on stackoverflow.com
🌐 stackoverflow.com
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
January 30, 2018
Convert SNMP Temp String to Float
InfoBlox decided to mark that OID as a "STRING" and thus Zabbix will read it as such. A work-around could be to use snmpwalk in an external script that parses the output and turns it into a numeric value. Look here for an example: https://www.zabbix.com/forum/showpost.php?p=159773&postcount=5 The script needs to be edited to: #!/bin/bash /usr/bin/snmpwalk -On -v 2c -c $1 .1.3.6.1.4.1.7779.3.1.1.2.1.1 | awk -F[+\ ] '{print $2}' More on reddit.com
🌐 r/zabbix
4
5
November 2, 2015
🌐
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.
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-string-into-float-in-javascript
Converting string into float in JavaScript - GeeksforGeeks
3 weeks ago - In JavaScript, a string can be ... with numeric input from forms, APIs, or user data. Use parseFloat(string) to convert a string into a floating-point number....
🌐
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
🌐
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 ...
Find elsewhere
🌐
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.
🌐
TutorialsPoint
tutorialspoint.com › how-to-convert-string-into-float-in-javascript
How to convert string into float in JavaScript?
February 21, 2023 - <!DOCTYPE html> <html> <title>parseFloat() function in JavaScript</title> <head> <script> function ex3() { let a = parseFloat("Nikhil007"); document.write("when number is not first character : " + a +"<br>"); let b = parseFloat("007Jamesbond"); document.write("when number is first character ...
🌐
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?

🌐
GeeksforGeeks
geeksforgeeks.org › how-to-convert-string-into-float-in-javascript
How to convert string into float in JavaScript? | GeeksforGeeks
June 21, 2024 - In this method, we will use the parseFloat() method which is an inbuilt function in JavaScript that is used to accept the string and convert it into a floating point number.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › parseFloat
Number.parseFloat() - JavaScript - MDN - Mozilla
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.
🌐
HScripts
hscripts.com › tutorials › javascript › string-float.php
Javascript (JS) Tutorial - type convert string to float, integer to string value
How to convert a float, interger value to string? c) Converting String to Float To convert a value from string to float, we have to use the function or method "parseFloat() to convert a string value to float.
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-convert-a-string-to-a-floating-point-number-in-javascript
How to convert a string to a floating point number in JavaScript?
<!DOCTYPE html> <html> <title>parseFloat() function in JavaScript</title> <head> <script> function ex2() { let a = parseFloat("183.1745"); document.write('The floating point number of the string will be: ' + a); } ex2() </script> </head> <body> ...
🌐
Flexiple
flexiple.com › javascript › parsefloat-javascript
parseFloat JavaScript: Syntax and Examples - Flexiple
March 14, 2022 - In this blog, let us understand the syntax, usage, and examples of the JavaScript parseFloat() function. The parseFloat() function is used to accept a string and convert it into a floating-point number.
🌐
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.
🌐
Plus2Net
plus2net.com › javascript_tutorial › math-parseFloat.php
parseFloat function to convert string to floating pont number in JavaScript
parseFloat(input_string); By using parseFloat function we can convert strings to float numbers. To convert string to integer we can use parseInt function.
🌐
Copahost
copahost.com › home › javascript parsefloat: examples and variations of this function
Javascript parseFloat: Examples and variations of this function - Copahost
July 16, 2023 - In JavaScript, the parseFloat() function is basically used to convert a string to a floating-point number.
🌐
Codecademy
codecademy.com › docs › javascript › number methods › .parsefloat()
JavaScript | Number Methods | .parseFloat() | Codecademy
May 31, 2024 - The following examples demonstrate how the .parseFloat() method is used to convert a value to a floating-point number: // Parses the number 3.14 as a floating-point number. ... // Parses the string ' 2.59 ' as a floating-point number after trimming ...