Skip to content

Commit

Permalink
Merge pull request godotengine#29616 from Calinou/humanize-size-clear…
Browse files Browse the repository at this point in the history
…er-rounding

Make humanized size rounding clearer by padding decimals with zeroes
  • Loading branch information
akien-mga authored Jun 12, 2019
2 parents 4073da7 + 463d098 commit f410e7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/ustring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3232,7 +3232,7 @@ String String::humanize_size(size_t p_size) {
int digits = prefix_idx > 0 ? _humanize_digits(p_size / _div) : 0;
double divisor = prefix_idx > 0 ? _div : 1;

return String::num(p_size / divisor, digits) + prefix[prefix_idx];
return String::num(p_size / divisor).pad_decimals(digits) + prefix[prefix_idx];
}
bool String::is_abs_path() const {

Expand Down

0 comments on commit f410e7a

Please sign in to comment.