RTF Number Formatting is a key concept if you are working on an XML report or BI Report. Why you asked? Because more often than naught, your client will be finicky to expect the number in a specific format like comma for thousand separator or numbers to be formatted in a specific length. So let’s see few of the options you have at your disposal.
Here are the syntaxes for various RTF Number Formatting examples ( My XML has a TAG called AMOUNT in it, you may have to change it depending on the name and path of it ):
1. To simply print the number: <?AMOUNT?>
2. To have comma as thousand separator and Decimal Value: <?format-number:AMOUNT;’999G999D99‘?>
3. To get the floor value: <?format-number:AMOUNT;’999G999‘?>
4. To get the value with + sign before a positive Value: <?format-number:AMOUNT;’S999G999‘?>
5. To get the value with Currency Code: <?format-number: (-1)*AMOUNT;’ 999G999D99C‘?>
Let’s see how the output looks like for above syntaxes. Below are two screenshots. First one has the RTF and code syntax, other one is the output.
Now if you see the code closely, we are using 9 for any digit. Wondering what happens if we replace it with a 0. Let’s see:
Hopefully it helped.. Try your hands and let us know how did it play out.
Related Posts
RTF- Looping Finite Number Of Times
How To Develop an RTF Template
RTF Date Formatting With Example
BI Report Development In Oracle Fusion
Feedback:
Hope the article helped you. If it did, please rate the post. In case it didn’t, do leave a comment to let us know what did we miss.
Reference:
support.oracle.com
Check out the Amazon Deals of the day based on your interests..
1 thought on “RTF Number Formatting With Examples”
Comments are closed.