Perad Posted May 25, 2008 Share Posted May 25, 2008 If a number has periods or commas in it. What would happen if this field was converted from varchar to integer Link to comment https://forums.phpfreaks.com/topic/107165-varchar-to-int/ Share on other sites More sharing options...
AndyB Posted May 25, 2008 Share Posted May 25, 2008 It will destroy the integrity of the data. Things with commas are strings not numbers. Sounds as though you need to convert your data into floating point numbers and store them in a field type float or decimal. How you display them in the browser is immaterial. Link to comment https://forums.phpfreaks.com/topic/107165-varchar-to-int/#findComment-549445 Share on other sites More sharing options...
fenway Posted May 29, 2008 Share Posted May 29, 2008 Quote If a number has periods or commas in it. What would happen if this field was converted from varchar to integer You can test the effect of this using asking for "yourColumn+0" in the select column list... it will likely get truncated at the first non-numeric character. Link to comment https://forums.phpfreaks.com/topic/107165-varchar-to-int/#findComment-552668 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.