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

displaying currency

Status
Not open for further replies.

jacobus

Programmer
Apr 16, 2001
15
NL
howdy all,

I've got a small but annoying problem ..

I retrieve a currency value from a database.
If the value is, say 34.50 , only the number 34.5 is shown.
I've tried ccur() and round(x,n) but that doesn't work.

Somebody got an idea ?

thanks
jacobus
 
use the formatcurrency function

Dim MyCurrency
MyCurrency = FormatCurrency(34.50)
' MyCurrency contains $34.50 [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Thanks onpnt.
The number is shown ok.
But now this...

On my computer (win98 dutch) currency is set to display in euros.
On the server (win2000 eng.) currency is set to display in euros.

However, using FormatCurrency displays a $ -sign !
Is it me or eh ...
 
I would jsut do this then
dim Mymsg
money = "34.5"
money = FormatNumber(money,2)
' 2 in the FormatNumber function = 2 decimal places
Mymsg = msgbox(money)


Or I found this and you can do it on the select in the SQL statement
[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
I'm going with the FormatNumber(x,n) one.
I'll keep the "format( UnitPrice , '##,##0.00')" for later.

Thanks again.
jacobus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top