Sorry for leaving this post for so long, I've been really busy this week.
I'm trying to get the data within the database to contain both whole integers and decimals with a limit to two decimal places (so that's integers: 23 and decimals with two places: 23.50).
Now when I changed the price field to a FLOAT it solved the problem except for one thing. It allow more then two decimal places, so 12.333 was valid. When I set the price field FLOAT(12, 2) it had the same effect ad DECIMAL(12,2), which is decimals all the time even with a .00 decimal value.
So what I need is a data type that will meet this criteria:
- Values stored in the column do not require a decimal value when no decimal is written. So for example, If a number like 11 or 11.00 is inserted into the column, 11.00 will not be what's stored, rather just 11.
- Decimal values must be limited to two places. So 12.345 will be stored as 12.34.
- If possible, decimal values should ALWAYS contain two places. So 11.1 will be stored as 11.10. In other words, when ever there is a decimal value in the number there should always be two places displayed in the field.
I'd really like to meet these issues with MySQL, or at least as much as possible. Also, this field is called price, I will be storing monetary values in it. So does FLOAT has any inconsistencies that may not be suitable for dealing with money?
Thank you so much for all the input already. Obviously I wasn't in a clear state of mind in my OP. I hope I've written more clearly this time.