Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- lsof
- VirtualBox
- import
- find
- Source
- 네트워크
- vscode
- Eclipse
- maVen
- 단축키
- Mac
- profile
- grep
- GIT
- ssh
- Quartz
- 줄바꿈 문자
- plugin
- JavaScript
- Windows 10
- tomcat
- context
- port
- IntelliJ
- xargs
- resource
- web.xml
- netsh
- Windows
- bash
Archives
- Today
- Total
develog
format number 본문
DECLARE
FUNCTION FN_FORMAT_SCORE(P_SCORE NUMBER)
RETURN VARCHAR2
IS
V_SCORE VARCHAR2(20);
BEGIN
V_SCORE := NVL(P_SCORE, 0);
V_SCORE := TRIM(TO_CHAR(V_SCORE, '9,990.9'));
RETURN V_SCORE;
EXCEPTION
WHEN OTHERS
THEN
RETURN TO_CHAR(NVL(P_SCORE, 0));
END FN_FORMAT_SCORE;
BEGIN
DBMS_OUTPUT.PUT_LINE(FN_FORMAT_SCORE(NULL));
DBMS_OUTPUT.PUT_LINE(FN_FORMAT_SCORE('0'));
DBMS_OUTPUT.PUT_LINE(FN_FORMAT_SCORE(0));
DBMS_OUTPUT.PUT_LINE(FN_FORMAT_SCORE(100));
DBMS_OUTPUT.PUT_LINE(FN_FORMAT_SCORE(1000));
DBMS_OUTPUT.PUT_LINE(FN_FORMAT_SCORE(1000.9));
DBMS_OUTPUT.PUT_LINE(FN_FORMAT_SCORE(1007.9));
END;
Comments