日期:2014-05-17 浏览次数:20846 次
CREATE OR REPLACE FUNCTION GET_PERCENT (V_ARG1 NUMBER, V_ARG2 INT) RETURN VARCHAR2 IS V_RESULT VARCHAR2(100); BEGIN IF (V_ARG2 IS NULL) THEN V_RESULT := TO_CHAR(ROUND(V_ARG1*100,2))||'%'; ELSE V_RESULT := TO_CHAR(ROUND(V_ARG1*100,V_ARG2))||'%'; END IF; RETURN V_RESULT; END;