I used this function to check if a value is a number:
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
My program need to work with German values. We use a comma as the decimal separator instead of a dot, so this function doesn't work.
I tried to do this:
n.replace(",",".")
But it also doesn't seem to work. The exact function I tried to use is:
function isNumber(n) {
n=n.replace(",",".");
return !isNaN(parseFloat(n)) && isFinite(n);
}
The number looks like this 9.000,28 instead of the usual 9,000.28 if my statement wasn't clear enough.
.s when the number is greater than 999?replacereturns a new string.replace. That should be sufficient so there must be something else wrong.