phpMyAdmin need to show decimal

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

phpMyAdmin need to show decimal

Post by jonnyfortis »

I have a column showing "number of weeks" the trouble i am having is some of the weeks are not full so i have 14, 9, and 4.333333 weeks

i have tried
type DECIMAL 10,2 and 10, 6 but this is just showing 4.00 or 4.000000

i also tried float and this is showing the same

i need the decimal to show the only value 4.333333
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

Re: phpMyAdmin need to show decimal

Post by jonnyfortis »

i have used VARCHAR and seems to work ok
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: phpMyAdmin need to show decimal

Post by Celauran »

If you're looking to store a decimal, it makes more sense to use DECIMAL for the column. You can always pass the results through number_format or similar for formatting in your app.
Post Reply