Number to Word conversion in RTF

xdofx vs xdoxslt

<?xdofx:expression?> for extended SQL functions
<?xdoxslt:expression?> for extended XSL functions.

You cannot mix xdofx statements with XSL expressions in the same context

This function enables the conversion of numbers to words for RTF template output. This is a common requirement for check printing.

The new function is “to_check_number”. The syntax of this function is

<?xdofx:to_check_number(amount, precisionOrCurrency, caseType, decimalStyle)?>

The following table describes the function attributes:

 
Attribute Description Valid Value
amount The number to be transformed. Any number
precisionOrCurrency For this attribute you can specify either the precision, which is the number of digits after the decimal point; or the currency code, which will govern the number of digits after the decimal point. The currency code does not generate a currency symbol in the output. An integer, such as 2; or a currency code, such as ‘USD’.
caseType The case type of the output. Valid values are:
‘CASE_UPPER’,
‘CASE_LOWER’,
‘CASE_INIT_CAP’
decimalStyle Output type of the decimal fraction area. Valid values are:
‘DECIMAL_STYLE_FRACTION1’, ‘DECIMAL_STYLE_FRACTION2’,
‘DECIMAL_STYLE_WORD’

The following examples display the function as entered in an RTF template and the returned output:

 
RTF Template Entry Returned Output
<?xdofx:to_check_number(12345.67, 2)?> Twelve thousand three hundred forty-five and 67/100
<?xdofx:to_check_number(12345.67, ‘USD’)?> Twelve thousand three hundred forty-five and 67/100
<?xdofx:to_check_number(12345, ‘JPY’, ‘CASE_UPPER’)?> TWELVE THOUSAND THREE HUNDRED FORTY-FIVE
<?xdofx:to_check_number(12345.67, ‘EUR’, ‘CASE_LOWER’, ‘DECIMAL_STYLE_WORDS’)?> twelve thousand three hundred forty-five and sixty-seven

Please note this is only available for R12 and not currently present on 11i.

Alternative

<?xdoxslt:toWordsAmt(TEST_AMOUNT)?>

Then it will display amount in words in Indian currency means Rupees not millions.

Example:

<?xdoxslt: toWordsAmt(123454.879)?>

Then it will display as

One Lakh Twenty Three thousand Four hundred Fifty Four and paise Eighty Eight

Alternative

Use the following function in rdf level

IBY_AMOUNT_IN_WORDS.Get_Amount_In_Words(TEST_AMOUNT)

 

 

Advertisements

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