Number Format - Decimal places.

J

Justin

I have a system that records attribute data. An Engineer enters a
specification range for the values and an integer value for the desired
number of decimal places to display. I have the following formula in my
report's record source

Round([Act_Value], Nz([Dec_Place],0))

This works to limit the number of decimals, but doesn't "set" the display.
For example
[Act_value] = 0.5
[Dec_place] = 3
The above formula will diplay 0.5. I want it to display 05.00.

Is there a way to do this? Any help will be appreciated.
 
J

John Spencer

To force the number to a string format with the correct number of
characters. You might try the following

FORMAT([Act_Value], "0." & String(Dec_Place,"0"))

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

Use the format function
Format(Round([Act_Value], Nz([Dec_Place],0)),"00.00")
Evi


Justin said:
I have a system that records attribute data. An Engineer enters a
specification range for the values and an integer value for the desired
number of decimal places to display. I have the following formula in my
report's record source

Round([Act_Value], Nz([Dec_Place],0))

This works to limit the number of decimals, but doesn't "set" the display.
For example
[Act_value] = 0.5
[Dec_place] = 3
The above formula will diplay 0.5. I want it to display 05.00.

Is there a way to do this? Any help will be appreciated.
 

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