Number Formatter class omits the digits after 2 decimal places
29 views
Skip to first unread message
Atul
unread,
Sep 5, 2011, 12:42:06 PM9/5/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
Hi,
I want to change a double value to USD currency format, so i used
NumberFormat class of com.google.gwt.i18n.client.NumberFormat package.
So when i say NumberFormat.getCurrencyFormat().format(doubleValue) it
returns me string in US$ format but only upto 2 places of decimal. I
don't want to loose original fraction values. There is no method in
this class as setMaximumFractionDigits(int newValue) in
java.text.NumberFormat. Please help me.
Jens
unread,
Sep 5, 2011, 1:28:06 PM9/5/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
You can always use NumberFormat.getFormat(String pattern) to provide your own custom pattern or you use NumberFormat.getCurrencyFormat(CurrencyData data). You can try to use DefaultCurrencyData or provide your own implementation of CurrencyData.