I am developing an android app in which i convert double values of latitude and longitude to string at android side and save them in wamp database as varchar using my server side php, but what i want is to convert these values back to double before storing into database and then store these values as dobule in database. So please help me how to do this and also tell what should be the datatype to store double values in mysql ? Thanks.
Use floatval()..Also Check doubleval()
e.g
$var = '86.389';
$float_value_of_var = floatval($var);
echo $float_value_of_var; // 86.389
You can also do that by using binary calculator.Check this link too
$s = '123412.13';
$double = bcadd($s,'0',2);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments