Hi,
I need to round up vaules in a table to every 0,5... How can I do that?
I need values like 1,1 and 1,2 and 1,3 and 1,4 and 1,5 to be presented as 1,5. 1,6 to 1,9 to be rounded to 2.....
Please help...
Hi,
I need to round up vaules in a table to every 0,5... How can I do that?
I need values like 1,1 and 1,2 and 1,3 and 1,4 and 1,5 to be presented as 1,5. 1,6 to 1,9 to be rounded to 2.....
Please help...
assuming your values only go to 1 decimal place, this should work
((((myValue-0.1)*10) \ 5)+1)*0.5
replace myValue with your field name
if your values go to more than 1 decimal places, you need to modify the 0.1
so 1.51 on above will round to 1.5
this
((((myValue-0.01)*10) \ 5)+1)*0.5
will round to 2
Thanks Ajax,
I´ve tried your solution and it seems to work for any value with a decimal but every integer will now have 0,5 added,, so 1 becomes 1,5 and 2 becomes 2,5. I need the integer to be left as is... any idea?
Code:If Int(YourValue) <> YourValue Then Do the rounding Else Leave it alone End If
just tried this
((((1-0.1)*10) \ 5)+1)*0.5
and it returns 1
modify the other one to
((((myValue-0.01)*100) \ 50)+1)*0.5