CREATE OR REPLACE FUNCTION convert_en2bn_number (num varchar2)
RETURN VARCHAR2
/******************************************************************************
NAME: convert_en2bn_number
PURPOSE:
REVISIONS:
Ver Date Author Description
--------- ---------- --------------- ------------------------------------
1.0 3/21/2023 Md. Quium Hossain 1. Created this function.
NOTES:
Automatically available Auto Replace Keywords:
Object Name: convert_en2bn_number
Sysdate: 3/21/2023
Date and Time: 3/21/2023, 1:48:13 AM, and 3/21/2023 1:48:13 AM
Username: Md. Quium Hossain (set in TOAD Options, Procedure Editor)
Table Name: (set in the "New PL/SQL Object" dialog)
******************************************************************************/
IS
p_num VARCHAR2 (100) := TO_CHAR (num);
p_char CHAR (1);
o_str NUMBER := 14722982;
vBnNum VARCHAR2 (500);
BEGIN
FOR i IN 1 .. LENGTH (p_num)
LOOP
p_char := SUBSTR (p_num, i, 1);
IF p_char = '.'
THEN
o_str := 46;
ELSE
o_str := 14722982 + TO_NUMBER (p_char);
END IF;
vBnNum := vBnNum || CHR (o_str);
END LOOP;
RETURN vBnNum;
/*
CREATE OR REPLACE FUNCTION format_comma_en2bn_number(in_value NUMBER)
RETURN VARCHAR2 IS
BEGIN
RETURN TRANSLATE(TO_CHAR(in_value,'fm99G99G99G99G99G99G990D99',
'nls_numeric_characters=''.,'''),
'0123456789','০১২৩৪৫৬৭৮৯');
END;
/
*/
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
-- Consider logging the error and then re-raise
RAISE;
END convert_en2bn_number;
/