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!

problem with currency values

Status
Not open for further replies.

AndreAraujo

Programmer
Feb 14, 2002
62
PT
hi everyone,
im having some problems performing operations to get currency values.
the result total and desc returns a strange value.
if total = 1 * 74.80 the total is 74.80D

Code:
dim total, desc as decimal
total = (txt_quant.Text * txt_unit.Text)
desc = ((total * txt_desc.Text) / 100)

Any ideas?
Thanks in advance,
Andre
 
Code:
dim total, desc as decimal
total = (val(txt_quant.Text) * val(txt_unit.Text))
desc = ((total * val(txt_desc.Text)) / 100)

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
hi chrissie1, the total and desc still display the D after the number.

Thanks anyway.
 
There is not "Currency" datatype. Furthermore, you would use a type, not a string in the ctype() function.
 
That doesn't work either. He is wanting to set a decimal datatype. The format function returns a string.
 
Yeah, total would remain a decimal, but the output is what I'm assuming he's concerned about. Where ever he needs to display the total or desc he can use the format command to display it as a valid currency.

-Rick

----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top