[thelist] Numbers Just Don't Add Up

Bob Blackman bob at kaboomconsulting.com
Wed Jan 17 12:22:02 CST 2007


Thank you both!

I was able to fix my problem with:

invoiceTotal = eval(invoiceSubtotal) + eval(invoiceShipping) +
eval(invoiceCOD)

Thaks again, Bob

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Lee kowalkowski
Sent: Wednesday, January 17, 2007 1:12 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] Numbers Just Don't Add Up


On 17/01/07, Bob Blackman <bob at kaboomconsulting.com> wrote:
>
> I get the evaluation of
>
> invoiceTotal = invoiceSubtotal + invoiceShipping + invoiceCOD
>
> Displays 10010.
>
> I have been looking for a method to cast the values as numbers but 
> haven't come across anything.

It doesn't matter how you initialise a variable in JS, a variable will
be the type of it's last assignment.  Referencing formField.value brings
strings into the mix.

var number = new Number(string);

Is the best way to cast.

-- 
Lee
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 






More information about the thelist mailing list