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

format currency with digit decimal

Status
Not open for further replies.

Learnerprog

Programmer
Apr 21, 2004
52
US
Hello all,
is there a format express or a way in visual basic 6.0 to format a value i.e. 100 = 100.00. no matter, what I try it always give me 100 and I want i to show as 100.00.

Thanks, Joe
 
Code:
myDouble = format(100, "###.00")
To expand on this, read up on the Format function in VB help.

HTH

Bob
 
For currency you can try the Formatcurrency function as well.
Code:
Debug.Print FormatCurrency(100)

zemp
 
I sort of blew that one. myDouble should be myString. Format outputs are to strings. If you declared myDouble as double, and then ran my line of code, the result would be 100, same as joe is getting. So joe, make sure that you're plugging the result into a string.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top