x_maras Posted April 21, 2010 Share Posted April 21, 2010 Hi, I am inserting some numbers, which I get from the url, into a database. In the database the type of these fields are both "float(11,7)". My problem is that the number changes a bit when it goes to the database. It changes in its last digit but it is important for me even this digit... here I ve got an example of the numbers 40.6366335 22.9522282 (these are two numbers that I get from the url) 40.6366348 22.9522285 (and these are the same numbers stored in the database) Is there a way to have in the database the first numbers? Thanks, Dinos Link to comment https://forums.phpfreaks.com/topic/199266-string-to-float/ Share on other sites More sharing options...
Mchl Posted April 21, 2010 Share Posted April 21, 2010 Use DECIMAL data type for exact numers. FLOAT is not precise. Link to comment https://forums.phpfreaks.com/topic/199266-string-to-float/#findComment-1045882 Share on other sites More sharing options...
x_maras Posted April 21, 2010 Author Share Posted April 21, 2010 OK This was perfect. 1000 thanks Link to comment https://forums.phpfreaks.com/topic/199266-string-to-float/#findComment-1045883 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.