filled in size placeholder and other malarkey
This commit is contained in:
parent
7449d1c351
commit
c8e6e761d0
4 changed files with 25 additions and 20 deletions
|
@ -57,7 +57,7 @@ const LOCALIZE_NUMBERS = !!(
|
|||
);
|
||||
|
||||
const UNITS = ['B', 'kB', 'MB', 'GB'];
|
||||
function bytes(num) {
|
||||
function bytes(num, decimalDigits = 1) {
|
||||
if (num < 1) {
|
||||
return '0B';
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ function bytes(num) {
|
|||
try {
|
||||
const locale = document.querySelector('html').lang;
|
||||
nStr = n.toLocaleString(locale, {
|
||||
minimumFractionDigits: 1,
|
||||
maximumFractionDigits: 1
|
||||
minimumFractionDigits: decimalDigits,
|
||||
maximumFractionDigits: decimalDigits
|
||||
});
|
||||
} catch (e) {
|
||||
// fall through
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue