User | Kudos |
---|---|
11 | |
3 | |
2 | |
2 | |
2 |
Hi,
I'm bit afraid to post this idea, because it seems to be I could overlook something.
There is no function which do the proper rounding (with 5 a a last digit as a hard limit) as below:
If the last digit is 5 o greater round up, otherwise round down.
An example:
(to simplify I use only one digit after dot)
0.1 -> 0
0.4 -> 0
0.5 -> 1
0.9 -> 1
1.1 -> 1
1.4 -> 1
1.5 -> 2
1.9 -> 2
2.1 -> 2
etc.
Now to satisfy this function you have to do coding like this (just for numbers with one digit after the dot):
Why to complicate so simple thing???
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea that has not received any kudos within a year after posting will be automatically declined.