

Your question can be interpreted as partially vague and very specific at the same time. Meaning that I'm not sure if you are asking specifically about the numbers 5142.37 and 5150 or if you are asking about any double. Regarding the numbers you quotedhere is an idea (code not compiled or tested): RoundedNumber = (MathFloor(5142.37 / 10) + 1) * 10; The above code is just an example to give you some ideas about how to go from a very specific question (about the numbers 5142.37 and 5150) to a more general answer (how to round a double to the nearest 10). 

Alberto_jazz: could you indicate a system to round the number 5142.37 to 5150


WHRoeder:
@WHRoder: Not quite sure how you come up with 5160.




@WHRoeder Ahhh, I see what you mean...yes, you are right. An exact value at the high end would round up, rather than staying the same. I like your MathNearest() function. I think two additional companion functions would also be good: double MathRoundDown(double v, double to){ return to * MathFloor(v / to); } double MathRoundUp(double v, double to){ return to * MathCeil(v / to); } Examples:

Hi all, could you indicate a system to round the number 5142.37 to 5150 ?
Thank you!