Oracle R12 : Converting Number into words ( trick )


This is not very regular but kind of very good trick. How to Convert number into strings.  Here is a standard Oracle Package , generally used in AP side but can be use in your code also.

Solution:
SELECT ap_amount_utilities_pkg.ap_convert_number(12345) AS amt_in_words    FROM dual;

Output:
AMT_IN_WORDS

———————
Twelve thousand three hundred forty-five

We used this in some localized reports  and check printing.

About these ads

2 responses to “Oracle R12 : Converting Number into words ( trick )

  1. Try using below query, it should work

    SELECT
    ‘Rupees ‘
    || ap_amount_utilities_pkg.ap_convert_number (substr(123456.21, 1,InStr(123456.21, ‘.’)-1 ))
    || ‘ and ‘
    || ap_amount_utilities_pkg.ap_convert_number (SubStr(123456.21,InStr(123456.21, ‘.’)+1))
    || ‘ Paise ‘
    FROM dual;

    Results:
    Rupees One hundred twenty-three thousand four hundred fifty-six and Twenty-one Paise

  2. I have used this as well, but this ignores the fractional amount

    Regards
    Ariv

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s