dayzdockerserver/web/docroot/src/util.js
Daniel Ceregatti 29ce456543 Let's just use the store to do all reactivity.
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.
2023-08-14 09:10:35 -07:00

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 }