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

format a number type double

Status
Not open for further replies.

ultimatewilliam

Programmer
Oct 16, 2002
57
SG
im using CR Developer 8.5 and i want to format a certain number whose value is 8.55 would be formated as "8.55" but if the value is 8.00 then "8" only. is there any direct function for this? thanks.
 
Hi !

If you select your field and choose "Format Field" and under "Number" click on "Customize".
Click on the "X+2-button" on the right side of "decimals".

There you write a formula like this:

if {number.field}-truncate({numberfield})<>0 then 2 else 0

/Goran
 
i forgot to mention that i'm going to use that formatting within a formula so i'm looking for a direct fuction to create it. thanks anyway.
 
Hi !

Maybe you can try this:

if {number.field} = 0 then
ToText({number.field},0)
else
if {number.field} / int({number.field}) > 1 then
ToText({number.field})
else
ToText(int({number.field}),0)


/Goran
 
Gorans first suggestion IS formatting with a formula. I do not understand what is wrong with that solution. Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top