mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-08-14 10:43:32 +00:00

Refactor the DOM to allow for "sections". Add our start.sh scripts to /usr/local/bin in the image. Add a config for Vue. Remove globalproperties, as this...sucks.
11 lines
284 B
JavaScript
11 lines
284 B
JavaScript
const units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
|
|
|
|
const BKMG = (val) => {
|
|
let l = 0, n = parseInt(val, 10) || 0
|
|
while(n >= 1024 && ++l){
|
|
n = n/1024
|
|
}
|
|
return(n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l])
|
|
}
|
|
|
|
export { BKMG }
|