Laubender, My code had one glicth, also i had written it on the suppostion that the input no will have only one dot and one comma the question also intends this i think. So my corrected code would be var inputNo = "999.999,50" var PIndex = inputNo.indexOf(".") var Cindex = inputNo.indexOf(",") var len = inputNo.substring(PIndex + 1, Cindex).length; var lenAfterRounding = String(Math.round(inputNo.replace(",", ".").substring(PIndex + 1))).length; var roundOffNo; if(lenAfterRounding > len) roundOffNo = inputNo.substring(0, PIndex ) * 1 + 1; else roundOffNo = inputNo.substring(0, PIndex + 1) + Math.round(inputNo.replace(",", ".").substring(PIndex + 1)) In this snippet i have handled the situation when the input no is something like 999.999,50 where rounding off would also effect the number before the decimal. I have added 1 to the number before decimal in case the rounding of the number after decimal causes a carry over. Manan Joshi - Efficient InDesign Solutions - MetaDesign Solutions http://metadesignsolutions.com/services/indesign-development.php
... View more