일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- spring form tag
- SSL
- 전자정부 표준프레임워크
- jquery
- maven
- exception
- json
- 오라클
- 스크립트
- DB
- 한글
- java
- Oracle
- html
- 네이버스마트 에디터
- 웹 플랫폼 설치 관리자
- @RequestBody
- checbox
- null
- 호환성
- JSTL
- MYSQL
- HTML5
- php
- 이클립스
- 날짜
- switch
- 문자열
- RADIO
- 톰캣
- Today
- Total
개인적인 정리
[Oracle]ROUND(number) 본문
오라클 ROUND(number)
ROUND(number)
-
ROUND(n)
ROUND(n, integer)
의 형태
ROUND returns n rounded to integer places to the right of the decimal point. If you omit integer, then n is rounded to zero places. If integer is negative, then n is rounded off to the left of the decimal point.
n can be any numeric data type or any nonnumeric data type that can be implicitly converted to a numeric data type. If you omit integer, then the function returns the value ROUND(n, 0) in the same data type as the numeric data type of n. If you include integer, then the function returns NUMBER.
ROUND is implement using the following rules:
1. If n is 0, then ROUND always returns 0 regardless of integer.
2. If n is negative, then ROUND(n, integer) returns -ROUND(-n, integer).
3. If n is positve, then
ROUND(n, integer_ = FLOOR(n * POWER(10, integer) +0.5)* POWER(10, -integer)
ROUND applied to a NUMBER value any give a slightly different result from ROUND applied to the same value expressed in floating-point. The different results arise from differences in internal representations of NUMBER and floating point values. The difference will be 1 in the rounded digit if a difference occurs.
SQL> SELECT ROUND(15.193, 1) FROM DUAL ;
--> 15.2
SQL> SELECT ROUND(15.193, -1) FROM DUAL ;
--> 20
'DB > ORACLE' 카테고리의 다른 글
오라클 컬럼 이름 변경 (0) | 2021.02.19 |
---|---|
[Oracle]RTRIM() (0) | 2020.06.11 |
[Oracle]RPAD() (0) | 2020.06.11 |
[Oracle]ROW_NUMBER() (0) | 2020.06.11 |
[Oracle]ROUND(date) (0) | 2020.06.10 |
[Oracle]REPLACE() (0) | 2020.06.10 |
[Oracle]REMAINDER() (0) | 2020.06.10 |
[Oracle]REGEXP_SUBSTR() (0) | 2020.06.08 |