Loading lesson path
Concept visual
Start at both ends
Return a number truncated to 2 decimal places:
SELECT TRUNCATE(135.375, 2);The TRUNCATE() function truncates a number to the specified number of decimal places.
FLOOR(), CEIL(), CEILING(), and
functions.
number, decimals )
Required. The number to be truncated decimals Required. The number of decimal places to truncate to
From MySQL 4.0
Return a number truncated to 0 decimal places:
SELECT TRUNCATE(345.156,
0);❮ MySQL Functions