taith Posted January 25, 2007 Share Posted January 25, 2007 why does it output 01? i just need a simple math to add two numbers without making it a string...[code]var w=0;var h=w+1;[/code] Link to comment https://forums.phpfreaks.com/topic/35665-simple-math/ Share on other sites More sharing options...
taith Posted January 25, 2007 Author Share Posted January 25, 2007 never mind... found an easy enough way... var w=0var h=w*1+1 Link to comment https://forums.phpfreaks.com/topic/35665-simple-math/#findComment-168953 Share on other sites More sharing options...
paul2463 Posted January 25, 2007 Share Posted January 25, 2007 it doesnt in mine, inside javascript tags it outputs 1 not 01 Link to comment https://forums.phpfreaks.com/topic/35665-simple-math/#findComment-168959 Share on other sites More sharing options...
fenway Posted January 25, 2007 Share Posted January 25, 2007 JavaScript has loose typing... if you really care, use Number() or String(). Link to comment https://forums.phpfreaks.com/topic/35665-simple-math/#findComment-169058 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.