Help - Search - Members - Calendar
Full Version: Any way to make MYSQL do NOT remove nulls at the end of number?
HTMLHelp Forums > Programming > Databases
Samuell
Is that possible?
I mean is it possible to hold in db numbers like 6.780 or 0.30 or 9.00?
Thanks in advance!
Brian Chandler
You don't mean "null" (in English: in lots of languages, from Bahasa Indonesia to Swedish, UIMM, 'nul' or similar means zero, but in English "null" means something not even a number.

Anyway, the *numbers* 7.8, 7.80, and 7.800 are exactly the same value. If you want to show a certain number of decimal places, just use appropriate formatting in output (e.g. in php use the C-style printf() functions). If you want to be able to hold "7.8" and "7.80" as distinct values in the database you need to hold them as strings.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.