Skip to content

Commit

Permalink
Fixed #782 - #numbers.format*() expression utility methods not produc…
Browse files Browse the repository at this point in the history
…ing numbers using the correct digit symbols for locales that use them, in JDK versions where NumberFormat does this (currently >= JDK15).
  • Loading branch information
danielfernandez committed Dec 3, 2020
1 parent 30e8b8d commit 283f70a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
3.0.12
======
- Fixed #numbers.format*() expression utility methods not producing numbers using the correct digit symbols for
locales that use them, in JDK versions where NumberFormat does this (currently >= JDK15).
- Fixed "package-list" not being produced for JavaDoc since JDK 11 started being used for compiling the project.
- Updated OGNL dependency to 3.1.26.
- Updated jackson-databind to 2.11.3 and jackson-datatype to 2.11.3 (due to vulnerabilities in previous versions).
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/thymeleaf/util/NumberUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private static DecimalFormatSymbols computeDecimalFormatSymbols(
Validate.notNull(thousandsPointType, "Thousands point type cannot be null");
Validate.notNull(locale, "Locale cannot be null");

final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
final DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);

switch (decimalPointType) {
case POINT :
Expand All @@ -236,8 +236,7 @@ private static DecimalFormatSymbols computeDecimalFormatSymbols(
symbols.setDecimalSeparator(' ');
break;
case DEFAULT :
final DecimalFormatSymbols dfs = new DecimalFormatSymbols(locale);
symbols.setDecimalSeparator(dfs.getDecimalSeparator());
// No changes needed to the "symbols" variable defined above
break;
case NONE :
// This should never happen
Expand All @@ -255,8 +254,7 @@ private static DecimalFormatSymbols computeDecimalFormatSymbols(
symbols.setGroupingSeparator(' ');
break;
case DEFAULT :
final DecimalFormatSymbols dfs = new DecimalFormatSymbols(locale);
symbols.setGroupingSeparator(dfs.getGroupingSeparator());
// No changes needed to the "symbols" variable defined above
break;
case NONE :
// This should never be shown
Expand Down

0 comments on commit 283f70a

Please sign in to comment.