CREATE FUNCTION numToEasternArabic(
in_value IN NUMBER
) RETURN NVARCHAR2 DETERMINISTIC
IS
p_num VARCHAR2(100) := TO_CHAR( in_value );
p_char CHAR(1);
o_str NVARCHAR2(100);
BEGIN
FOR i IN 1 .. LENGTH( p_num ) LOOP
p_char := SUBSTR( p_num, i, 1 );
o_str := o_str
|| CASE p_char
WHEN '.'
THEN N'.'
ELSE UNISTR(
'\' || TO_CHAR(
TO_NUMBER( p_char ) + 660,
'FM0000'
)
)
END;
END LOOP;
RETURN o_str;
END;
/
Query 1:
SELECT numToEasternArabic( 1438 )
FROM DUAL
Results:
| NUMTOEASTERNARABIC(1438) |
|--------------------------|
| ١٤٣٨ |
Comments
Tags: Arabic In Oracle, convert from English to arabic in oracle, convert number from English to arabic, convert number from English to arabic in oracle, Database DBA, DBA, English To Arabic In Oracle, Oracle Application, oracle apps oracle 11g, oracle convert from English to arabic, oracle convert number from English to arabic, Oracle DBA, Oracle Query, Select number and convert number from English to arabic in oracle