Scroll untuk baca artikel
DatabaseOracle

Rounding Functionality in Oracle

180
×

Rounding Functionality in Oracle

Sebarkan artikel ini
oracle database big
oracle database big

In Oracle / PLSQL, there is a rounding function, which is round (). In general, the command is as follows:
round (number, [decimal_places])
number is the number to be rounded
decimal places is the number of rounded decimal places. If not filled, then the result will be no number behind the comma.Example:

SELECT ROUND(15.193,0) FROM DUAL	will return 15
SELECT ROUND(15.193,1) FROM DUAL	will return 15.2
SELECT ROUND(15.193,2) FROM DUAL	will return 15.19
SELECT ROUND(15.193,-1) FROM DUAL	will return 20

What if rounded is not an integer? For example, floating point . Means will be rounded to even the closest number. Example:

SELECT ROUND(1.5f) FROM DUAL	will return 2.0E+000
SELECT ROUND(2.5f) FROM DUAL	will return 2.0E+000

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

Situs ini menggunakan Akismet untuk mengurangi spam. Pelajari bagaimana data komentar Anda diproses.

Verified by MonsterInsights