2023-04-10 15:36:59 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2021-03-29 23:16:48 +00:00
|
|
|
import Helper from '@ember/component/helper';
|
|
|
|
import { formatScheduledHertz } from 'nomad-ui/utils/units';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scheduled Hertz Formatter
|
|
|
|
*
|
|
|
|
* Usage: {{format-scheduled-hertz hertz}}
|
|
|
|
*
|
|
|
|
* Outputs the frequency reduced to the resolution the scheduler
|
|
|
|
* and job spec operate at.
|
|
|
|
*/
|
|
|
|
function formatScheduledHertzHelper([hertz], { start }) {
|
|
|
|
return formatScheduledHertz(hertz, start || 'MHz');
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Helper.helper(formatScheduledHertzHelper);
|