Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Force String to Float?
- From: tedd at sperling.com (tedd)
- Subject: [Javascript] Force String to Float?
- Date: Mon May 14 20:25:41 2007
Hi gang: I can do this: var one = document.autoSumForm.a1.value; var two = document.autoSumForm.d1.value; document.autoSumForm.t1.value = one * two; and everything is OK. But, if I do this: var one = document.autoSumForm.a1.value; var two = document.autoSumForm.d1.value; document.autoSumForm.t1.value = one + two; the result is not what I expect. Instead of getting 2 + 3 = 5, I get 2 + 3 = 23. So, how do I force a string to a float? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com
- Prev by Date: [Javascript] IE7 javascript profiler?
- Next by Date: [Javascript] Force String to Float?
- Previous by thread: [Javascript] Radio button Event seems to "lag" in IE
- Next by thread: [Javascript] Force String to Float?
- Index(es):