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:
Anton Georgiev 2020-07-10 11:31:32 -04:00 committed by GitHub
commit ebb80f3285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;