zmień kontrast font size: A A A
rss polski
you are at Encyclopedia of SQL >> ROUND()

ROUND(`column_name`,digits_after_comma)

It rounds given value with specified precision.

Syntax


SELECT ROUND(`column_name`,digits_after_comma)
FROM `table_name`

Example

Display rate of exchange with two digits after comma precision

currencyexchange rate
USD3,456352
EUR4,342135
CHF3,124424

query


SELECT `currency`,ROUND(`exchange_rate`,2)
AS er
FROM `people`

result

currencyexchange rate
USD3,46
EUR4,34
CHF3,12
[ wróć na górę strony ]