• Number To Indian Rupee Words in Oracle Forms / Reports


    Convert numbers to Indian Rupees format in Oracle Forms / Reports.

    Create the below mention function in Oracle Forms / Reports and call it with passing a number parameter.

    FUNCTION INR_words( p_number In number, vFrDec varchar2 Default 'Paisa Only')
    RETURN varchar2 As
    TYPE myArray Is Table Of varchar2(255);     
    TYPE myArray2 Is Table Of varchar2(255);
    l_str    myArray := myArray( '',
                       ' Thousand ', ' Lac ',
                       ' Crore ', ' Arab ',
                       ' Kharab ', ' quintillion ',
                       ' Sextillion ', ' Septillion ',
                       ' Octillion ', ' Nonillion ',
                       ' Decillion ', ' Undecillion ',
                       ' Duodecillion ' );
    l_str2 myArray2 := myArray2('Rs Paisa', '$ Pany');
        l_num   varchar2(50) Default Trunc( p_number );
        l_dec   varchar2(50) Default Substr(To_Char(p_number - Trunc(p_number), '.99'),2);
        l_return varchar2(4000);
        j number := 3;
    BEGIN
        For i In 1 .. l_str.Count
        LOOP
            EXIT When l_num Is Null;
            IF ( Substr(l_num, Length(l_num)-(j-1), j) <> 0 ) Then
               l_return := To_Char(To_Date(
                                Substr(l_num, Length(l_num)-(j-1), j),'J' ), 'Jsp' ) || l_str(i) || l_return;
            END IF;
            l_num := Substr( l_num, 1, Length(l_num)-j );
            j:=2;
        END LOOP;
        IF l_dec > 0 Then
            l_return := rtrim(l_return) || ' and ' || rtrim(inr_words(Substr(l_dec,2), Null)) || ' ' || rtrim(Initcap(vFrdec));
        END IF;
        RETURN Replace(l_return, '-', ' ');
    END;


  • 相关阅读:
    How to Automate IIS 7 Configuration with .NET
    windows phone 学习
    Redis VS. Memcached
    ROWNUM使用方法
    摘自----聊聊盛大的经验值
    理解Sql语句
    Odp.net 动态创建变量in
    ORACLE PLSQL DEVELOPER 中显示科学计数法
    http error 500.22 internal server error
    Resharper8 visual studio 中文版 快捷键无法使用
  • 原文地址:https://www.cnblogs.com/quanweiru/p/6220637.html
Copyright © 2020-2023  润新知