Sunday, February 26, 2012

format number with decimals

I need to know to format a field that has decimals.

If the decimal portion is .00 then I do not want to display it.

For example:
1234.01 would display as 1234.01
1234.00 would display as 1234

Any help would be great thanks.

Dean

I found the answer:

if int({field})= {field} then
formula = totext({field},"##########")
else
formula = totext({field},"##########.##")
end ifHi,
Try this

if right(Cstr({feild}),3)=".00" then
mid(cstr({feild}),1,len(cstr({feild}))-3)
else
cstr({feild});
Madhivanan

No comments:

Post a Comment