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