CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 Multiplication works but not addition

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.