JRS: In article <Pi*******************************@brok.diku.dk> , seen
in news:comp.lang.javascript, Svend Ezaki Tofte (DIKU)
<di******@diku.dk> posted at Thu, 6 Nov 2003 06:29:23 :-
On Wed, 5 Nov 2003, Stuart wrote:
I am occasionally having problems with adding numbers together. Sometimes
(not always) 2 + 2 = 22, Obviousy this is a string issue. I am using the
following method to overcome this problem, however I feel it is a bit
contrived, and i am sure there is a proper way of doing it!
If I want to force conversion, and I'm lazy, I go:
baz = 0 + foo + bar;
That's a nice easy method; the only fault, as far as I can see, is that
it does not work.
Tested solutions are safer.
Read the FAQ.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.