I have the following code:
var x = \"100.007\" x = String(parseFloat(x).toFixed(2)); return x => 100.01
This works awesomely just how I
You could do it using the lastIndexOf() function to find the last occurrence of the , and replace it.
,
The alternative is to use a regular expression with the end of line marker:
myOldString.replace(/,([^,]*)$/, ".$1");