Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
reportContext.getLocale() - want to format amount on locale
digit209
<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
digit209
<p>I found the solution here:</p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/23944-composite-fields/#entry85109'>http://developer.actuate.com/community/forum/index.php?/topic/23944-composite-fields/#entry85109</a></p>
;