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

numbers not adding 1

Status
Not open for further replies.

tyutghf

Technical User
Apr 12, 2008
258
GB
I have two numbers called from my database

strProductSubTotal = rs("productprice")
strDelivery = rs("delivery")

and I add them later

strSubTotal = strProductSubTotal + strDelivery

but the numbers are not adding

i.e.

strProductSubTotal = 2.50
strDelivery = 0.90

strSubTotal would be calculated as 2.500.90 but I need it to be 3.40

I tried converting the values to numbers using int but 2.50 was being output as 2.00 so the final calculation was 2.90.

How do I convert to a number and retain the decimals?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top