PDA

View Full Version : Calculation Rouning


ABC123

Fred Daniel
03-12-2005, 06:14 PM
Anybody know how to round a formula to the nearest .5. I'm writing a program to track usage based on 1.5 ounce increments.

Stan Mathews
03-12-2005, 06:43 PM
How about

case(mod(test,.5)=0,test,floor(test)=test-mod(test,.5),floor(test),.T.,ceiling(test))

substituting your formula everywhere I have the word test.

Fred Daniel
03-13-2005, 03:23 AM
Thanks Stan, I'll give it a try.