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: Tue May 15 06:22:05 2007
At 10:19 PM -0400 5/14/07, Noah Sussman wrote: >On 5/14/07, tedd <tedd@xxxxxxxxxxxx> wrote: >>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? > >document.autoSumForm.t1.value = one*1 + two*1; Noah: That's clever. Thanks. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com
- References:
- [Javascript] Force String to Float?
- From: Noah Sussman
- [Javascript] Force String to Float?
- Prev by Date: [Javascript] Force String to Float?
- Next by Date: [Javascript] Force String to Float?
- Previous by thread: [Javascript] Force String to Float?
- Next by thread: [Javascript] Force String to Float?
- Index(es):