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!

Formula for Trimming numeric fields 1

Status
Not open for further replies.

harley1d

IS-IT--Management
Feb 4, 2005
3
US
Using the following formula, How do I get this to only display the whole number if there is a "0" after the decimial point instead of a number? Example: if the formula return 18.5 this is ok but if it returns 18.0 I would like the 0 to be suppressed or trimmed.

Sum ({@Transfer}) % DistinctCount ({HSP_ACCOUNT.HSP_ACCOUNT_ID})

I tried using TRIMRIGHT but since this is a number field it isn't working.
 
Right click on the field->Format Object and click on the number tab and select the decimal option you want.
 
That's an odd request, as it goes against what most people like to see.

If you only want one digit of precision, here's a quick cheat:

Go into the decimals formula (Right click the number, select format field-Number->Customize->X 2 next to decimals) and use something like:

if remainder({table.field},int({table.field})) > 0 then
1
else
0

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top