Web developer, Norwich - Clive Portman

MySQL field for decimals

Published under MySQL

Published on Monday 23rd August 2010

Something like this:

price DECIMAL(8,2) default NULL,

The first figure refers to the total number of digits (exlcuding the decimal point) while the second figure is the number of digits permitted after the decimal point. Note this field-type can also accept negative values.