Bug 3819 - getNumber w/custom format doesn't take care of locale, fix included
Summary: getNumber w/custom format doesn't take care of locale, fix included
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: DBTags Taglib (show other bugs)
Version: 1.0B1
Hardware: PC FreeBSD
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-25 11:29 UTC by R
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description R 2001-09-25 11:29:32 UTC
If the current locale is "en_US", this tag :
<sql:getNumber position="1" format="0.00" locale="fr_FR"/>
will print "12.34" instead of "12,34" as it should.
                                 ^

The problem is in GetNumberTag.java, there :

 private static NumberFormat getNumberFormat (String strFormat, Locale loc)
  {
    NumberFormat fmt;
...
    else
      fmt = new DecimalFormat (strFormat);

I think this last line should be :

      fmt = new DecimalFormat (strFormat, new DecimalFormatSymbols(loc));

(although I didn't tested this fix)
Comment 1 R 2001-09-25 11:37:52 UTC
(changed the bugzilla version field to 1.0B1)
Comment 2 Morgan Delagrange 2002-04-15 03:51:22 UTC
I confirmed the problem and applied the fix.