You are here: irt.org | FAQ | JavaScript | Number | Q1503 [ previous next ]
If there is a comma it is not a number but a string. Do this:
<script language="JavaScript"><!-- myNumber = parseFloat(myCommaNumber.split(',').join('.')); and then use the round function in the number faq. after that you reverse it: myCommaNumber = "" round(myNumber); myCommaNumber = myCommaNumber.split('.').join(',')); //--></script>