Gary Finlay
|
Posted: 01/26/2005, 2:02 PM |
|
Let's say the values used in the expression below are...
Participants = 2
Fee = 10
document.bookings.FeeTotal.value = document.bookings.Participants.value *
document.bookings.Fee.value;
The above expression will give me a result in FeeTotal of 20 which is fine.
Now lets say the values of the fields below are....
Total1 = 20
Total2 = 30
document.bookings.GrandTotal.value = document.bookings.Total1.value +
document.bookings.Total2.value;
The above expression gives me a value of 2030 in GrandTotal. It's
concatenating the string values of the two Totals instead of adding them.
All fields are MySQL decimal and CCS float.
Multiplication works but not addition. I tried using StrToFloat() but got an
error.
Any ideas?
TIA
Gary Finlay
|
|
|
mrachow
Posts: 509
|
Posted: 01/27/2005, 1:39 AM |
|
Maybe there is a better way but try
Integer.parseInt(document.bookings.Total1.value) + ...
_________________
Best regards,
Michael |
|
|
peterr
Posts: 5971
|
Posted: 01/27/2005, 2:00 AM |
|
Just FYI, this issue was discussed here: http://forums.codecharge.com/posts.php?post_id=44752
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
|