|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Converting string to number and adding
Am collecting numerical entries from text boxes and converting to numbers using:
F1 = Round(CDbl(Request.Form("amout1")),2) F2 = Round(CDbl(Request.Form("amount2")),2) F3 = Round(CDbl(Request.Form("total")),2) F4 = F1 + F2 If F4 <> F3 Then Session("ErrorMessage") = Session("ErrorMessage") & "- Your control amounts do not tie to the Total Deposit amount.<br>" End if etc. Sometimes it works, but other times, although the numbers tie out, the calculated amounts are not coming up as equal. I've written the results (F3 & F4) to the screen and they equal, although the server doesn't think so. Is this an issue with binary number conversion or something. Should I be using something other than CRnd (Delphi has something like C$ or CCurrency)??? I've tried it (first actually) without the Round piece. Please Help! |
|
#2
|
|||
|
|||
|
either try cint(Request.Form("amout1")) or ccur(Request.Form("amout1"))
__________________
Hope this helps. Mike Royal Selangor Pewter "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931) |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Converting string to number and adding |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|