Number to Indian rupee Words in Oracle forms/reports

Source: Internet
Author: User
Tags rtrim

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 (+) Default Trunc (P_number);
L_dec varchar2 () 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;

Number to Indian rupee Words in Oracle forms/reports

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.