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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stop the rounding

Status
Not open for further replies.

mwa

Programmer
Jul 12, 2002
507
US
I have a number field in my table that contains a value such as:

0.3573

I want to display 2 decimal places, not rounded, like this:

0.35


CR9 allows you to format the field on the report to change the # of decimal places shown, but I can't get it to stop rounding and only show two decimal places. All I can seem to get is:

0.36

Any ideas on how to do this?

mwa
<><
 
Here's a cheat:

whileprintingrecords;
Stringvar TextNum := totext({table.field});
val(left(TextNum,instr(Textnum,".")+2))

-k
 
You can create a formula like this that truncates it and then turns it into a string:

totext(truncate(0.3573,2),2)

~Brian
 
Thanks...

sv: yours didn't seem to work. I still get .36

bd: yours does work. Thanks...

mwa
<><
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top