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
- port
- Mac
- 네트워크
- VirtualBox
- find
- lsof
- IntelliJ
- netsh
- import
- 단축키
- 줄바꿈 문자
- profile
- ssh
- tomcat
- resource
- Windows
- GIT
- maVen
- plugin
- Source
- Quartz
- context
- xargs
- vscode
- Windows 10
- bash
- JavaScript
- grep
- web.xml
- Eclipse
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