on 04-03-2007 9:19 AM
Hi,
I created a simpletype of the type double with representation #,##0.00 . When i put values in there it shows up on the screen as 1,000,000.00 . I understood that dependant of the locale, the representation could be also 1.000.000,00 for dutch languages for example. I want to test this for my app.....i tried adding the locale parameter to the end of the url but it didnt change anything....Anyone has a sugestion how to check this?
Much appreciated,
regards,
Hugo
Hi Hendriks,
You can use <b>java.text.NumberFormat</b>. Pass logon user's java.util.Locale to NumberFormat getCurrency method. Just follow the belwo code.
NumberFormat formatter = NumberFormat.getCurrencyInstance(locale);
formatter.setMaximumFractionDigits(2); // I want only 2 decimals
System.out.println(formatter.format(12345679.65236));
Hope this solves.
Thanks,
Raags
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hugo,
If your application requires authentication, you can change the language of the user. Otherwise you can change the language of the browser (in IE7: Options / General / Languages). You could also change the default language of the portal, or as a last resort, of the JVM e.g. by calling <i>java.util.Locale.setDefault(Locale.GERMAN);</i>.
Kind regards,
Sigiswald
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.