This commit is contained in:
Clebert Suconic 2020-07-08 11:39:21 -04:00
commit 500066621e
1 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import java.io.StringWriter;
import java.nio.ByteBuffer;
import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -449,6 +450,7 @@ public class ByteUtil {
i++;
}
return String.format("%.1f%sB", bytes / BYTE_MAGNITUDES[i], BYTE_SUFFIXES[i]);
// Set locale to language/country neutral to avoid different behavior for non-US users
return String.format(Locale.ROOT, "%.1f%sB", bytes / BYTE_MAGNITUDES[i], BYTE_SUFFIXES[i]);
}
}