Dooq Posted April 11, 2006 Share Posted April 11, 2006 HiHow can i change a string to number ?when i get the data using innerHTML method the data will be string,but i need to change the data type to do some Math work on it.Regards Quote Link to comment https://forums.phpfreaks.com/topic/7103-change-the-stringe-to-number-how/ Share on other sites More sharing options...
Develop_Sake Posted April 17, 2006 Share Posted April 17, 2006 There are several way to convert stringe to numeric.one of them is parseInt(); Function.parseInt('22')regards, Quote Link to comment https://forums.phpfreaks.com/topic/7103-change-the-stringe-to-number-how/#findComment-27913 Share on other sites More sharing options...
AndyB Posted April 17, 2006 Share Posted April 17, 2006 php variables are 'loosely typed'. If you add zero to a string you get a number. Quote Link to comment https://forums.phpfreaks.com/topic/7103-change-the-stringe-to-number-how/#findComment-27923 Share on other sites More sharing options...
Develop_Sake Posted April 18, 2006 Share Posted April 18, 2006 Maybe i didn't get what he need.we are in Javascript Help and he say [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]when i get the data using innerHTML[/quote] innerHTML toled me that he taking about JavaScript not php.regards Quote Link to comment https://forums.phpfreaks.com/topic/7103-change-the-stringe-to-number-how/#findComment-28162 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.