Skip to content

Do not attempt to pad time string if current length is sufficient #3676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ public static void validateFloat(Float input) {
}

public static String padLeft(int paddingAmount, int valueToPad) {
String value = Integer.toString(valueToPad);
int padding = paddingAmount - value.length();
StringBuilder result = new StringBuilder(paddingAmount);
for (int i = 0; i < padding; i++) {
result.append('0');
final String result;
final String value = Integer.toString(valueToPad);
if (value.length() == paddingAmount) {
result = value;
} else {
int padding = paddingAmount - value.length();
StringBuilder sb = new StringBuilder(paddingAmount);
for (int i = 0; i < padding; i++) {
sb.append('0');
}
result = sb.append(value).toString();
}
result.append(value);
return result.toString();
return result;
}

public static String[] splitNumberOnDecimal(String valueToSplit) {
Expand Down