Jump to content

Varchar to INT?


Perad

Recommended Posts

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

  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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.