|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Ok. Real Quick. What is the best Data Model for the following types of values? (Access 2000)
"Hello" (I'm using Text for this) "Insert a LOT of information here" (I'm using Memo for this) 0/1 (I'm using Number-Byte for this) 43 (I'm using Number-Long Int for this) 4.23 (I'm using Number-Double for this) A problem I'm having with my math and ASP/VBscript is this. What I want to do is take X% off the price of a object. So I do this price = rsProducts("prodPrice") ' the value of price is 85 percentOff = rsProducts("prodPercentOff") ' the value of percentOff is 10 tmpAmountOff = ((price - 0.00) / 100) * (percentOff - 0) Sure enough, if I output tmpAmountOff, I get 8. Which is wrong (should be 8.5) So what am I doing here? Wrong datatypes? Wrong math? I want the final numbers here to be decimal, and rounded at the second decimal place. I SHOULD get 8.5 back. And then I can use Response.Write("You saved : " & FormatCurrency(tmpAmountOff, 2,-2,-2,-2) Which should say: You saved : $8.50 Any help? My thanks in advance!
__________________
aaron martone professional web developer |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > problems with numbers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|