0

Can someone please help me on getting a formula round off to the next highest .25.

example:

2.35->2.50
2.26->2.50
2.24->2.25
2.51->2.75

I can't use the Round function because if I have 2.26 then it will round off to 2.25 which is unacceptable.

I have been using the Ceiling function but it rounds it off to the nearest highest integer. Which can add an almost extra kg,lb to my formulas.

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by ninjatalon
0

How did you do it? I quickly did it like this:

Dim d As Double = 2.51

d = Math.Floor(d) + (Math.Ceiling((d Mod 1) / 0.25) * 0.25)
0

Not as efficient as yours lol but easy as creating a function with if statements. I'll definitely use your code instead. Now if there was a way you could help me speed up my word automation.... anyways Thanks again, You've helped me so much with my program.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.