March 13, 200818 yr Hi all, I'm getting a bit confused here about how to configure a MySQL database table... can anyone help a newbie please! I need to create a field that will take either a whole number or a decimal number up to no more than 5 i.e '1' or '2.5', '4', 4.5' I have tried to use DECIMAL(1,1) UNSIGNED description but that seems to turn every entry I put into it (in phpMyAdmin) to 0.9 Im confused.. can anyone point me in the right direction here? Many thanks in advance Chris
March 13, 200818 yr Hello You could try using FLOAT. e.g. FLOAT(7,4) gives you display size of 7 with 4 digits after the decimal point. If you put FLOAT(1,1) MySQL will automatically make the display size 3 - It has to have the display size 2 digits bigger than the number of digits you require????? Theres also DOUBLE which is for big fat long numbers and takes up twice as much storage(8 bytes). Rob
Create an account or sign in to comment