This is "By Design". The parseFloat function will only consider the parts of the string up until in reaches a non +, -, number, exponent or decimal point. Once it sees the comma it stops looking and only considers the "75" portion.

  • https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFloat

To fix this convert the commas to decimal points.

var fullcost = parseFloat($("#fullcost").text().replace(',', '.'));
Answer from JaredPar on Stack Overflow
🌐
EyeHunts
tutorial.eyehunts.com β€Ί home β€Ί javascript parsefloat 2 decimal with comma | example code
JavaScript parseFloat 2 decimal with comma | Example code
January 25, 2022 - First, use the toFixed() method and then use the toLocaleString method to parseFloat 2 decimal with a comma in JavaScript.
Discussions

Javascript Formatting numbers with commas
Carlo Sabogal is having issues with: My level of js is very basic. Currently I am learning about basic number operations. My question is: How do you display numbers on the screen wi... More on teamtreehouse.com
🌐 teamtreehouse.com
5
May 15, 2015
floating point - How to parse float with two decimal places in javascript? - Stack Overflow
I have the following code. I would like to have it such that if price_result equals an integer, let's say 10, then I would like to add two decimal places. So 10 would be 10.00. Or if it equals 10.6... More on stackoverflow.com
🌐 stackoverflow.com
validation - Parsing numbers with a comma decimal separator in JavaScript - Stack Overflow
Using toLocaleString is the best option for me, thank you. 2024-01-30T07:52:12.283Z+00:00 ... I believe the best way of doing this is simply using the toLocaleString method. For instance, I live in Brazil, here we have comma as decimal separator. More on stackoverflow.com
🌐 stackoverflow.com
javascript - How can I parse a string with a comma thousand separator to a number? - Stack Overflow
I have 2,299.00 as a string and I am trying to parse it to a number. I tried using parseFloat, which results in 2. I guess the comma is the problem, but how would I solve this issue the right way? Just remove the comma? ... Yeah, but now the decimal places are lost. More on stackoverflow.com
🌐 stackoverflow.com
February 2, 2017
🌐
MDN Web Docs
developer.mozilla.org β€Ί en-US β€Ί docs β€Ί Web β€Ί JavaScript β€Ί Reference β€Ί Global_Objects β€Ί parseFloat
parseFloat() - JavaScript - MDN Web Docs
The characters accepted by parseFloat() are plus sign (+), minus sign (- U+002D HYPHEN-MINUS), decimal digits (0 – 9), decimal point (.), exponent indicator (e or E), and the "Infinity" literal.
🌐
Copahost
copahost.com β€Ί home β€Ί javascript parsefloat: examples and variations of this function
Javascript parseFloat: Examples and variations of this function - Copahost
July 16, 2023 - ... The value returned has no decimal when there no value passed in the toFixed method. Like other non-numbers, no character will be considered after a comma in the string passed in the parseFloat method.
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί how-to-parse-float-with-two-decimal-places-in-javascript
How to Parse Float with Two Decimal Places in JavaScript? | GeeksforGeeks
It slices the string up to the desired decimal precision and then converts it back to a number. ... function ParseFloat(str,val) { str = str.toString(); str = str.slice(0, (str.indexOf(".")) + val + 1); return Number(str); } console.log(ParseFloat("10.547892",2)) ... JavaScript is best known for web page development but it is also used in a variety of non-browser environments.
Published: January 9, 2025
🌐
Bobby Hadz
bobbyhadz.com β€Ί blog β€Ί javascript-format-number-to-two-decimal-places
Format a number to 2 Decimal places in JavaScript | bobbyhadz
The toFixed method takes a parameter, representing how many digits should appear after the decimal and returns the result. ... Copied!const num1 = 13.505; const result1 = num1.toFixed(2); console.log(result1); // πŸ‘‰οΈ 13.51 // ------------------------------------ const num2 = 13.504; const result2 = num2.toFixed(2); console.log(result2); // πŸ‘‰οΈ 13.50 // ------------------------------------ const str1 = '13.1'; const result3 = parseFloat(str1).toFixed(2); console.log(result3); // πŸ‘‰οΈ 13.10
🌐
Flavio Copes
flaviocopes.com β€Ί home β€Ί javascript β€Ί how to change commas into dots with javascript
How to change commas into dots with JavaScript - Flavio Copes
August 7, 2026 - The g flag in the regex makes sure that if there are multiple instances of a comma (or dot, in the second example) they are all converted. Modern JavaScript also gives us replaceAll(), which does the same job without a regex: ... After doing this substitution I called parseFloat(value) to get the float from the string, and then I limited the decimals to 2 using toFixed(2):
Find elsewhere
🌐
Stringerssociety
stg.stringerssociety.com β€Ί home β€Ί updates β€Ί javascript parse float is ignoring the decimals after my comma
Javascript parse float is ignoring the decimals after my comma - Modern Tech
July 31, 2026 - This is "By Design". The parseFloat function will only consider the parts of the string up until in reaches a non +, -, number, exponent or decimal point. Once it sees the comma it stops looking and only considers the "75" portion.
🌐
Attacomsian
attacomsian.com β€Ί blog β€Ί javascript-parse-float-two-decimal-places
Parse float with 2 decimal places in JavaScript
November 27, 2022 - Use the toFixed() method to format the floating point number to 2 decimal places. The toFixed() method takes a number as input and returns a string representation of the number formatted to 2 decimal places.
🌐
Seanmcp
seanmcp.com β€Ί articles β€Ί be-careful-parsing-formatted-numbers-in-javascript
Be careful parsing formatted numbers in JavaScript – seanmcp.com
December 20, 2022 - "1,000-2,000".split("-").map((string) ... says you probably shouldn't be using it like this anyway. The solution is to remove the commas before parsing....
🌐
TutorialsPoint
tutorialspoint.com β€Ί article β€Ί how-to-parse-float-with-two-decimal-places-in-javascript
How to parse float with two decimal places in JavaScript?
To parse float with two decimal places, use the concept of toFixed(2). Following is the code βˆ’ To run the above program, you need to use the following command βˆ’ Here, my file name is demo142.js. This will produce the following output βˆ’
🌐
javaspring
javaspring.net β€Ί blog β€Ί how-to-convert-string-into-float-in-javascript
How to Convert String to Float in JavaScript: Parsing Numeric Strings with Comma Separators β€” javaspring.net
In many European, South American, and Asian locales, the comma (,) is the decimal separator (e.g., "123,45" = 123.45). Thousand separators: These group large numbers (e.g., "1,234.56" in the U.S. or "1.234,56" in Germany, where dots are thousand ...
🌐
IncludeHelp
includehelp.com β€Ί code-snippets β€Ί how-to-parse-float-with-two-decimal-places-in-javascript.aspx
How to parse float with two decimal places in JavaScript?
To parse float with two decimal places, use the combination of parseFloat() and .toFixed() method. The parseFloat() method will parse the given string to float and .toFixed() method rounds the float value to a given number of digits. Below is the syntax to parse float with two decimal places: ...
🌐
W3Schools
w3schools.com β€Ί jsref β€Ί jsref_parsefloat.asp
JavaScript parseFloat() Method
The parseFloat() method parses a value as a string and returns the first number.
🌐
Bobby Hadz
bobbyhadz.com β€Ί blog β€Ί javascript-parse-string-with-comma-to-number
Parse a String with Commas to a Number in JavaScript | bobbyhadz
March 3, 2024 - We used an empty string for the replacement for each match to remove all commas from the string. The last step is to use the parseFloat() function to convert the string to a number.
🌐
xjavascript
xjavascript.com β€Ί blog β€Ί javascript-parsefloat-in-different-cultures
JavaScript parseFloat in Different Cultures: Does It Use Commas or Periods as Decimal Separators? β€” xjavascript.com
Short Answer: parseFloat() only recognizes periods (.) as decimal separators. Commas (,) are treated as non-numeric characters, causing parsing to stop early. The behavior is defined by the ECMAScript standard, which standardizes JavaScript.