How can i store decimal numbers in a MySQL database?
I want to have numbers like 22.50 or 7.15 in the database, but these are saved to the DB as 22 or 7 (i.e. withouht the decimal places).
This occurred also when using the DECIMAL type.
Thanks for your help.
can you store it in VARCHAR instead of INT? of course, i always take the easy way around things though 🙂
that works, but how do i also get it to separate '000 increments? like put a comma after number one in one thousand (i.e. 1,000)
well, if you decide yo use VARCHAR, you're going to have to do that in your php
if you have php 5, you could use something like str_split () to split it into groups of 3 numbers each, then implode () it with commas in between..
jared
is there any way to do it in MySQL when storing the data?
sorry, there's not that i know of...
why not store it as text, then do what you need to do with it in php?