You have to work around that. f.e. make a string of the double with str(x) with x as double. Then find the string behind the decimal point. Test that number and do whatever you like, f.e. if number<5 (when using 1 decimal) then x=x+1 and use round(x). 8.3 will become 9.
To my knowledge there is no function in VB that supports this.
I think a better description would be: "ReverseRounding". Where Round would go UP, he wants to go DOWN.
Where Round would go DOWN, he wants to go UP.
MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
One problem in that this uses scientific rounding. IE Round(8.5) = 8 (using scientific rounding, rounding to the nearest even number with the case of .5). But when I were a lad, I was taught (and I used to teach) that 8.5 rounded to 9.
Using the above, 8.5 will round to 9, but I think it should round to 8 the way you want it to work, from what I was taught.
I don't understand what point David is trying to make:
CCortez wanted to do the opposite of the normal rounding, so normally 2.0 would "round down" to 2 (even though the scalar value of the numbers 2.0 and 2 are the same it is said to round), so I reversed this to round up to 3
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.