Merge pull request #9792 from symptog/v2.2.x-release
Fix missing leading zeros in conference number for 2.2.x
This commit is contained in:
commit
ebb80f3285
@ -119,15 +119,15 @@ public class ParamsProcessorUtil {
|
|||||||
|
|
||||||
private String formatConfNum(String s) {
|
private String formatConfNum(String s) {
|
||||||
if (s.length() > 5) {
|
if (s.length() > 5) {
|
||||||
Long confNumL = Long.parseLong(s);
|
/* Reverse conference number.
|
||||||
|
* Put a whitespace every third char.
|
||||||
Locale numFormatLocale = new Locale("en", "US");
|
* Reverse it again to display it correctly.
|
||||||
String formatPattern = "#,###";
|
* Trim leading whitespaces.
|
||||||
DecimalFormatSymbols unusualSymbols = new DecimalFormatSymbols(numFormatLocale);
|
* */
|
||||||
unusualSymbols.setGroupingSeparator(' ');
|
String confNumReversed = new StringBuilder(s).reverse().toString();
|
||||||
DecimalFormat numFormatter = new DecimalFormat(formatPattern, unusualSymbols);
|
String confNumSplit = confNumReversed.replaceAll("(.{3})", "$1 ");
|
||||||
numFormatter.setGroupingSize(3);
|
String confNumL = new StringBuilder(confNumSplit).reverse().toString().trim();
|
||||||
return numFormatter.format(confNumL);
|
return confNumL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
Loading…
Reference in New Issue
Block a user