Floating decimal places for % in text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following expression in a text box on a report:

=IIF([type]="USE", FormatPercent([Rate]), FormatCurrency([OtherRate]),2)

The problem I'm having is that Rate might be .05, which I would like to show
as 5% or .03225, which I would like to show as 3.225%. I want it to show
however many decimals are in the table, but nothing more.

Thank you in advance for any help you can provide.
 
Liz said:
I have the following expression in a text box on a report:

=IIF([type]="USE", FormatPercent([Rate]), FormatCurrency([OtherRate]),2)

The problem I'm having is that Rate might be .05, which I would like to show
as 5% or .03225, which I would like to show as 3.225%. I want it to show
however many decimals are in the table, but nothing more.


Not sure what you're looking for, but this should cover at
least part of your question:

Format(Rate,IIF(Int(Rate*100)=0,".############%",IIf(Rate*100=Int(Rate*100),"0%","Percent")))
 
Back
Top