Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
reportContext.getLocale() - want to format amount on locale
Migrateduser
<p>Birt 3.7.1</p>
<p> </p>
<p>Hi,</p>
<p> </p>
<p>i have a "Dynamic Text" wich calculates "row[someAmount] * 12" and i want to format the amount.</p>
<p>I tried it with a new Style -> Format Number and format as Currency. This did not work!</p>
<p>I tried to use reportContext.getLocale(), but this only delivers the language "de" and not what i need "de_DE"</p>
<p>(language and Country)</p>
<p>Is there an other way to get the locale with language and country or to format an Dynamic Text?</p>
<p> </p>
<p>I want to use this code:</p>
<pre class="_prettyXprint _lang-js">
var currency = java.util.Currency.getInstance(reportContext.getLocale());
var format = java.text.NumberFormat.getCurrencyInstance(reportContext.getLocale());
format.setCurrency(currency);
var totalYear = row["TotalAmount"] * 12;
format.format(totalYear);
</pre>
<p>Greetings</p>
<p>Alex</p>
Find more posts tagged with
Comments
There are no comments yet