Rounding a decimal number to down
When we divide 5 by 2 we got a decimanl number: 2.5
When rounding the number we got a 3, well, I need to retrieve the 2
instead 3, I will round the number to down, to the unprecedented digit
instead to the precedent digit.
I've tried with a lot of Math class functions but I can't find anything to
do this.
PS: I'm looking to an improved way to do it, I don't want to do a
substring to the decimal output.
No comments:
Post a Comment