Provide a number rounded to two decimal places.
SELECT TRUNCATE(135.375, 2); |
The TRUNCATE() function cuts off a number to the designated decimal places.
Note: Refer also to the FLOOR(), CEIL(), CEILING(), and ROUND() functions.
TRUNCATE(number, decimals) |
Parameter |
Description |
number |
Mandatory: The number for truncation |
decimals |
Mandatory: The number of decimal places for truncation |
Works in: |
From MySQL version 4.0 |
Provide a number rounded to zero decimal places.
SELECT TRUNCATE(345.156, 0); |