keinname Posted December 6, 2010 Share Posted December 6, 2010 Hello.I have a field wich I want to round to two decimals.My Field in the source-XML: <invwert wrt="8.89">8,890</invwert>In iReport 2.0.5 I created two fields, one as double regarding on wrt="8.89" and one as string regarding on 8,890.I searched this forum and tried the following: Text field Expression Class: java.lang.Double Pattern: #,##0.00 Expression (the double value): $F{invwert_wrt} Result on Report: 889,00 Text field Expression Class: java.lang.String Pattern: #,##0.00 Expression (the stringvalue): $F{invwert} Result on Report: 8,890 Text field Expression Class: java.lang.String Pattern: nothing Expression: (new DecimalFormat("#,###,##0.00")).format($F{invwert}.doubleValue()).toString() Result on Report: 8,89 -> BUT: on my system ok, on a second system not?? Why? Text field Expression Class: java.lang.String Pattern: nothing Expression: String.valueOf(new DecimalFormat("#,###,##0.00").getInstance(Locale.GERMAN).format($F{invwert_wrt})) Result on Report: 889 Did anyone see the problem or can tell me the solution? Thanks for your help... Link to comment Share on other sites More sharing options...
hozawa Posted December 19, 2010 Share Posted December 19, 2010 You're probably running on Linux and don't have LANG environmental property set on your 2nd machine. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now