2017-12-15 21:39:18 +00:00
|
|
|
import Helper from '@ember/component/helper';
|
2021-03-26 04:55:55 +00:00
|
|
|
import { formatBytes } from 'nomad-ui/utils/units';
|
2017-10-17 01:45:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Bytes Formatter
|
|
|
|
*
|
|
|
|
* Usage: {{format-bytes bytes}}
|
|
|
|
*
|
|
|
|
* Outputs the bytes reduced to the largest supported unit size for which
|
|
|
|
* bytes is larger than one.
|
|
|
|
*/
|
2021-03-26 04:55:55 +00:00
|
|
|
function formatBytesHelper([bytes]) {
|
|
|
|
return formatBytes(bytes);
|
2017-10-17 01:45:07 +00:00
|
|
|
}
|
|
|
|
|
2021-03-26 04:55:55 +00:00
|
|
|
export default Helper.helper(formatBytesHelper);
|