java - Localizing numeric values in excel -
bigdecimal mynumber = new bigdecimal(1234.56); numberformat instance = numberformat.getinstance(locale.german); string localizednumber = instance.format(mynumber); system.out.print("\nformatting " + localizednumber); o/p ->1.234,56
till here code works fine below line gives numberformatter exception given string contains comma in it.
bigdecimal bigdecimal = new bigdecimal(localizednumber);
i want numeric values localized cannot homecoming string putting number string shows below error in excel number in cell formatter text or preceded apostrophe
is there way can homecoming numeric value(bigdecimal / integer / biginteger etc) in localized format won't above error in excel , can perform filter operations on excel data.
i've tried new bigdecimaltype().valuetostring(value, locale); , new bigdecimaltype().stringtovalue(s, locale); of dynamic jasper reports api.
happy reply question asked me , quite surprised no 1 replied this. don't have number localization in excel export because it's done our operating scheme settings automatically.
go "region , language" -> format -> select language/country name -> apply , check excel before generated in english.
you see numbers in selected country's number format. :)
java excel dynamic-jasper
No comments:
Post a Comment