Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Currency Format with 2 or 3 Decimal Places

Status
Not open for further replies.
May 7, 1999
130
US
I can format US currency as having two or three decimal places (the default being two, of course). However, I have the situation where thhe values for stamps are either whole cents or half-pennies. I'd like to display the numbers as, for example, $0.34 (or 34c, where c is the cents sign) and $0.345 or $0.34 5, where the 5 is in superscript format when the value has a half-cent component. If I need to

Is there any convenient way to format these values?

Thanks,

John Harkins
 
Hi, this is not exactly formatting per se, but you could do something like this:

Price: IIf(Len([value])=3,[value] & "c","$" & Mid([value],1,3) & " " & "5")

It assumes you are working with 3 or 4 characters - .34 or .345 for example. The above would display .34c or $.34 5

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top