Commit d75a49fd authored by Miguel Rincon's avatar Miguel Rincon

Refactor formatUsageSize to use a simple function

parent 3dbb300d
import { numberToHumanSize, bytesToKiB } from '~/lib/utils/number_utils';
import { getFormatter, SUPPORTED_FORMATS } from '~/lib/utils/unit_format';
import { kibibytes } from '~/lib/utils/unit_format';
import { PROJECT_STORAGE_TYPES, STORAGE_USAGE_THRESHOLDS } from './constants';
export function usageRatioToThresholdLevel(currentUsageRatio) {
......@@ -22,9 +22,8 @@ export function usageRatioToThresholdLevel(currentUsageRatio) {
* @param {Number} size size in bytes
* @returns {String}
*/
export const formatUsageSize = (size) => {
const formatDecimalBytes = getFormatter(SUPPORTED_FORMATS.kibibytes);
return formatDecimalBytes(bytesToKiB(size), 1);
export const formatUsageSize = (sizeInBytes) => {
return kibibytes(bytesToKiB(sizeInBytes), 1);
};
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment