Displaying Decimals As Percentages without Rounding on a Report

ahoneycutt

New member
Local time
Today, 02:39
Joined
Mar 31, 2015
Messages
9
I have a field that comes from a make-table and is set to Double. This field is used to display different types of values like .994965 as well as 47 and 1.08. So changing the field type is not an option to meet my need.

I need to display all the data that reads .994965 or any number similar to that and display it as a percentage on a report which is working fine except the reader needs to see the actual number and not the rounded one. For example, .994965 I need to read as 99.49%.

The report is using a Switch function to determine how to display that field on the report. It is applying the FormatPercent function to this field with 2 decimal places. Therefore, it changes the number to read, 99.50% which is correct, however, I need it to read, 99.49%.

I understand that .994965 is truly 99.50% but for this situation the view needs to read it without the rounding.

I can't change the formatting of the table but can change a query or the report.

Is there any other method of displaying this number as a percentage without Access actually converting it to a percentage?

Any suggestions would be greatly appreciated.
 
Try this:

=Int([YourFieldHere]*10000)/100 & "%"
 
This works great. Thanks so much.

One small thing (I know I'm pushing my luck here).

If I have a number that reads, 0.9730902123, the result displays 97.3%.

Any chance I can get it to ready 97.30%?

I can live without it but for display purposes it looks out of alignment with the other numbers that have two digits.

Thanks again, this helps tremendously.
 
try

format(val(left(0.9730902123, 6)),"00.00%")

or if you need to keep the value as numeric use

val(left(0.9730902123, 6))

and set the format property as required
 
CJ_London, thanks for the input but I am not sure I can use it. Let me give you more info.

On the report there is a switch command that decides based on another field what to do with the number I listed.

=Switch([Attainment_Format]="Percent",(Int([Attainment]*10000)/100 & "%"),[Attainment_Format]="Basis_Point",FormatNumber([Attainment],0)

If the number reads 0.994965 this produces 99.49% which is exactly what I want.

If the number reads 0.973090 this produces 97.3% not 97.30%. I can't format this field because of the other value being displayed so that is why the Switch command is being used.

How would I incorporate your format into this Switch command?

Thanks in advance.
 
use my formula instead of the one provided by Plog

Switch([Attainment_Format]="Percent", format(val(left([Attainment], 6)),"00.00%")
,[Attainment_Format]="Basis_Point",FormatNumber([Attainment],0)
 
It is important to realise that Single and Double data types do not actually support calculations at the level of precision that they display. This is due to the inaccuracies of storing a decimal number in a binary system.

For example, calculate the result of this expression:

Int(63 / 0.7)

Precise calculations require a Decimal datatype which stores the number as an Integer with a scaling factor.
 

Users who are viewing this thread

Back
Top Bottom