Numbers to Words Update

Been a while I know, crazy busy, which is not a bad thing but the blog suffers. Last week was spent embedded in all things 11g BI including the new version of Publisher. There are some very cool and more importantly useful, features coming. My favorite is the new data builder tool; no more 'notepad' to build more complex data structures, oh no!
Its a great drag and drop interface that lets you pull in multiple sources, join them and then group the data to generate a hierarchical data set. You can then abstract the element names to friendly functional names for your layout template builders. There are also some new sources, such as LDAP and Excel - cant wait to share more on the new stuff. Before you ask, I can not tell you when its coming ... you know the drill.

Back to my numbers to words update. String of mails flying around over the toWordsAmt function; typically used in check printing.

<?xdoxslt:toWordsAmt(12345.98)?>

generates 'Twelve Thousand Three Hundred Fourty Five and paise Ninety Eight' It always appears to return the subunit in 'Paise'. Upon investigation the 'paise' is hardcoded; this function was written for some Crystal conversion routines that made it into core code.
A few mails later and it emerges that we would like you to use another function that it a bit more robust and has some more options.

<?xdoxslt:to_check_number(12345.98,2)?>

Typical use of this function is :

xdofx:to_check_number(12345.67, 2) 

--> Twelve thousand three hundred forty-five and 67/100

The user can also pass a currency for its precision.

xdofx:to_check_number(12345.67, 'USD') 

--> Twelve thousand three hundred forty-five and 67/100

Note that the currency is only for precision. No currency word, e.g. dollar or cent, is included in output.

All capital output is available with CASE_UPPER key word.

xdofx:to_check_number(12345, 'JPY', 'CASE_UPPER')

--> TWELVE THOUSAND THREE HUNDRED FORTY-FIVE

CASE_INIT_CAP, CASE_UPPER, and CASE_LOWER are available.

The user also change the style of decimal area, if needed.

xdofx:to_check_number(12345.67, 'EUR', 'CASE_LOWER', 'DECIMAL_STYLE_WORDS') 

--> twelve thousand three hundred forty-five and sixty-seven

DECIMAL_STYLE_FRACTION1(default), DECIMAL_STYLE_FRACTION2, and DECIMAL_STYLE_WORDS are available.

Please note for EBS customers this is only available for R12. Its not currently presnt on 11i. You could log a backport request via support thou.

Have a play and you'll be printing words in no time.

Comments:

FYI - the to_check_number functionality is also documented in the BI Publisher New Features Guide that was released with 10.1.3.4.1: http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e14667/toc.htm#BABHCACD

Posted by Leslie on February 07, 2010 at 11:15 PM MST #

I am working on a template where I need to display currency_code and Book_class in the begining of the template but in the xml file they are located in the end of the group. Hereis the xml file, SARGENT & LUNDY 1 01 64130 0105 1 34345435 USD CORPORATE How do you display company_code and book_class up top in the report.

Posted by Nilofer on February 09, 2010 at 01:46 AM MST #

In the RTF template, I am planning to convert number to word. If I try for hard coded values, the conversion is successful for e.g. or , but if I try to replace the number with XML Tag, it fails. Please provide your input.

Posted by Ankit on March 30, 2010 at 01:44 AM MDT #

Ankit Without seeing your template and data its tough to comment Tim

Posted by Tim Dexter on March 30, 2010 at 03:39 AM MDT #

50 cent is way over rated. He should have retired after he put out "In the Club". Good writing, but i can't say that I like hearing about fifty cent.

Posted by Forte 4 Kids on April 18, 2010 at 01:59 PM MDT #

Fifty cent is not as good as people think. He should have retired after he put out "In the Club". Good writing, but i can't say that I like hearing about 50 cent.

Posted by Calms Forte on April 18, 2010 at 02:10 PM MDT #

50 is the man. Top artist, but more than that he's also an amazing media personality and marketing genius.

Posted by Virginia Miskin on May 26, 2010 at 12:59 AM MDT #

Hi Tim,

I am trying use this function in my RTF template. It's working fine with the hardcoded values but not with the TAG values.

Example: <?xdofx:to_check_number(1000,'USD','CASE_UPPER','DECIMAL_STYLE_WORDS')?>

This is working fine.
But
<?xdofx:to_check_number(TOTAL_INV_AMOUNT,'USD','CASE_UPPER','DECIMAL_STYLE_WORDS')?>

This one prints the amount in number only

Please Help.
Thanks
Sushil.

Posted by Sushil Kumar on November 15, 2011 at 11:51 PM MST #

Hi,

How can i store the result of <?xdofx:to_check_number(TOTAL_INV_AMOUNT,'USD','CASE_UPPER','DECIMAL_STYLE_WORDS')?> inside a variable.

Please help.

Thanks,
Satyender

Posted by guest on April 10, 2013 at 06:14 PM MDT #

Satyender
Check out todays post just for you
https://blogs.oracle.com/xmlpublisher/entry/variable_numbers_to_words

Posted by Tim on April 11, 2013 at 10:43 AM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today