Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding UP to next Whole number on Formula 1

Status
Not open for further replies.

cinbh

MIS
Apr 16, 2002
58
US
I need to round UP (only) my formula field results to the next whole number whenever I have a decimal value .
For Example:
10.70 = 11.00
.80 = 1.00
1.40 = 2.00
ETC.
I have seen some threads using truncate, but I don't see how I'm able to get it to work for this situation. Of course, I'm still learning in Crystal and pretty much a novice with this sort of programming. We currently are using Crystal 8.0 with VisualFoxPro 7.0.
Any help is greatly appreciated.
Cindy B-H
 
Try this one: It basically if the number minus the number without decimals not equal to zero then get rid of the poin whatever and add one otherwise just show the number.


if {number.field} - truncate({number.field}) <> 0 then truncate({number.field})+1 else
{number.field} Mike
 
THANK YOU! Worked like a charm.[2thumbsup]
Cindy B-H
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top