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 question 1

Status
Not open for further replies.

crystaln00b

Programmer
Aug 10, 2005
23
US
Hi all,

I have a problem with a formatting issue. I have a field data type of number. I need it to show two places after the decimal when needed, but i don't want it show zeros after the decimal if they are zeros.

Is there a solution to this?? right now, i have it set to show 2 decimal places....

thanks n00b

Crystal Version: 9.0 VS.NET
 
Go to format field->number->customize->decimals->x+2 and enter:

if val(right(totext({table.number},2),2)) = 0 then 0 else
if val(right(totext({table.number},2),1)) = 0 then 1 else 2

This would also give you only one decimal place if the rightmost value is zero.

-LB
 
i'll try it tomorrow and let you know

thanks

Crystal Version: 9.0 VS.NET
 
thank you lb, it worked like a charm....

n00b

Crystal Version: 9.0 VS.NET
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top