MySQLNumeric FunctionsTRUNCATE
ROUND

TRUNCATENumeric Functions

MOD

Truncates x to d decimal places.

Syntax

TRUNCATE(x, d)

Example

Enter values below to update the example in real time.

product_name
price
price_100
products
-- 단가를 100원 단위 이하 버림
SELECT product_name, TRUNCATE(price, -2) AS price_100
FROM products;