UNPKG

welcome-ui

Version:

Customizable design system with react • styled-components • styled-system and ariakit.

11 lines (10 loc) 281 B
"use client"; const a = (t, o = 2) => { if (t === 0) return "0 Bytes"; const s = 1024, n = o < 0 ? 0 : o, r = ["Bytes", "KB", "MB", "GB"], e = Math.floor(Math.log(t) / Math.log(s)); return parseFloat((t / Math.pow(s, e)).toFixed(n)) + " " + r[e]; }; export { a as f };