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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>Make format currency show zeros for even $ in text string</b> 1

Status
Not open for further replies.

Lightningfast

Technical User
Jul 27, 2002
18
AU
I have a field with number in currency format sell$. I want to add this to a text string in format so it looks like $5.00 when there are no cents instead of $5 as it does now
heres the code I am using Str([sell$] Anybody know how?
Thanks Trevor
 
No real need to convert it to a text string. On a table, report or form or query, there is a Format property associated with each field. If you set this property to Currency, it should give you the two decimal positions you want.

You can do lots of interesting things with the format property. Read more about it in online help.
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
On the format prperty, you can specify Currency and then in the decimal places (just below format) you can specify 2, rather than auto, and it will always display 2 decimal places (i.e. the "cents")
 
Thanks Guys
Steve's got it. Its just keep it simple I went thru all the formats but because I come from coding environ wanted to use both fuctions eg: STR(sell$,format(###.##)) or something similar .Its much simpler though I nutted it out eventually and this works fine.
Format([sell$],"$0.00")
Digsys way doesn't work with text, still shows $5.
Thanks guys from down under,
TP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top