1internet Posted November 20, 2012 Share Posted November 20, 2012 I am trying to store integers that contain decimals. When I select the type INT, it will not allow me to use decimals. What type do I need? It's just for numbers like 2.4, or 6.3, one decimal place is fine. Quote Link to comment https://forums.phpfreaks.com/topic/270928-mysql-type-for-integers-with-decimals/ Share on other sites More sharing options...
Pikachu2000 Posted November 20, 2012 Share Posted November 20, 2012 Integers, by definition, are not decimal. They are whole numbers. Quote Link to comment https://forums.phpfreaks.com/topic/270928-mysql-type-for-integers-with-decimals/#findComment-1393682 Share on other sites More sharing options...
kicken Posted November 20, 2012 Share Posted November 20, 2012 11.2. Numeric Types Quote Link to comment https://forums.phpfreaks.com/topic/270928-mysql-type-for-integers-with-decimals/#findComment-1393686 Share on other sites More sharing options...
1internet Posted November 20, 2012 Author Share Posted November 20, 2012 So which one do I need to represent e.g. 5.4? Quote Link to comment https://forums.phpfreaks.com/topic/270928-mysql-type-for-integers-with-decimals/#findComment-1393726 Share on other sites More sharing options...
Muddy_Funster Posted November 20, 2012 Share Posted November 20, 2012 Either float or decimal set with 1 decimal place Quote Link to comment https://forums.phpfreaks.com/topic/270928-mysql-type-for-integers-with-decimals/#findComment-1393729 Share on other sites More sharing options...
Christian F. Posted November 20, 2012 Share Posted November 20, 2012 Follow kicken's link, and read: You'll find out. Quote Link to comment https://forums.phpfreaks.com/topic/270928-mysql-type-for-integers-with-decimals/#findComment-1393731 Share on other sites More sharing options...
fenway Posted November 21, 2012 Share Posted November 21, 2012 Don't use approximate data types with an exact one will do. Quote Link to comment https://forums.phpfreaks.com/topic/270928-mysql-type-for-integers-with-decimals/#findComment-1393988 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.