Show only 2 decimal places *IF* the last digit is a zero?

peskywinnets

Registered User.
Local time
Today, 17:10
Joined
Feb 4, 2014
Messages
578
I can't figure how to solve this,

I have a report calculation field that I want conditional decimal places on, for example if the calculation results in the last digit as being anything other than a zero, say $4.325 to show with all three decimal places ...i.e. $4.325 , BUT if the calculation results in a number like $3.920 (a zero on the end) ...I just want it to show on the report as $3.92

How do I approach this?
 
Try a format of

0.00#
 
Try a format of

0.00#

Thanks, to re-itereate, this is for a calculated field in a report, where do I put that formating instrction...

 
In the format property of the textbox.
 
In the format property of the textbox.

Sorry, for being a bit slow, do you mean here...




(if you are saying that box, then unfortunately that doesn't work...access won't store the value 0.00# in that box)
 
No, the format property, three above that one.
 
Bingo....many thanks (I hadn't realised that field was typable...I thought you could only use the drop down arrow & choose from their options - Doh!)

Seems to be working...thanks once again :-)
 
Last edited:
Happy to help! You can actually type a 4-part custom format there; the 4 parts can handle positive/negative/zero/null values differently.
 

Users who are viewing this thread

Back
Top Bottom