github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/helpers/format-bytes.js (about) 1 import Helper from '@ember/component/helper'; 2 import { formatBytes } from 'nomad-ui/utils/units'; 3 4 /** 5 * Bytes Formatter 6 * 7 * Usage: {{format-bytes bytes start="KiB"}} 8 * 9 * Outputs the bytes reduced to the largest supported unit size for which 10 * bytes is larger than one. 11 */ 12 function formatBytesHelper([bytes], { start }) { 13 return formatBytes(bytes, start); 14 } 15 16 export default Helper.helper(formatBytesHelper);