There are various ways to store decimal numbers in MySQL but the simplest is probably to make the Datatype = float and the Length or Len = 10,2.

10 is the total number of digits. 2 is the number of digits following the decimal point.

Skip to content
PHP & MySQL# How do you store decimal numbers in MySQL?

Nikolai Bird

There are various ways to store decimal numbers in MySQL but the simplest is probably to make the Datatype = float and the Length or Len = 10,2.

10 is the total number of digits. 2 is the number of digits following the decimal point.