Floating decimal places for % in text box

L

Liz C

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.
 
M

Marshall Barton

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")))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top