Notice: session_start(): A session had already been started - ignoring in /home/u614325693/domains/onedoubt.com/public_html/post.php on line 3
TRUNCATE - ONEDOUBT.COM

Example

Return a number truncated to 2 decimal places:

SELECT TRUNCATE(135.375, 2);

Definition and Usage

The TRUNCATE() function truncates a number to the specified number of decimal places.

Note: See also the , , , and functions.

Syntax

TRUNCATE(number, decimals)

Parameter Values

Parameter Description
number Required. The number to be truncated
decimals Required. The number of decimal places to truncate to

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Return a number truncated to 0 decimal places:

SELECT TRUNCATE(345.156, 0);


Login
ADS CODE