0

I have a field in a mysql table, the field name is menu_price. The value of menu_price is displayed as 50.000.
However i want this value to be 50.00 instead of 50.000.
My client does not want to show the price as 50.000. So i need to change it to 50.00.

atul
  • 134
  • 2
  • 14
  • Read this : http://stackoverflow.com/questions/9944001/delete-digits-after-two-decimal-points-without-rounding-the-value – Devsi Odedra Oct 22 '16 at 08:10

2 Answers2

0

How about

CAST(2229.999 AS DECIMAL(6,2)) to get a decimal with 2 decimal places
Mayank Pandeyz
  • 25,704
  • 4
  • 40
  • 59
0

When i clicked on 'structure' in mysql table to see the field types etc, for 'menu_price', this field is having the data type 'decimal'.
Along with data type 'decimal', the next type is 'Length/Values'.

The Length/Values was set to 15,3 and because of which i was getting 50.000 i.e. 3 digits after the decimal.

I changed it to 15,2. So now the value for price is showing as 50.00

atul
  • 134
  • 2
  • 14