return '0 B';
};
+export const formatCWLResourceSize = (size: number) => {
+ return `${(size / CWL_SIZE.base).toFixed(0)} ${CWL_SIZE.unit}`;
+};
+
export const formatTime = (time: number, seconds?: boolean) => {
const minutes = Math.floor((time / (1000 * 60)) % 60).toFixed(0);
const hours = Math.floor(time / (1000 * 60 * 60)).toFixed(0);
const FILE_SIZES = [
{
- base: 1099511627776,
+ base: 1024 ** 4,
unit: 'TiB',
},
{
- base: 1073741824,
+ base: 1024 ** 3,
unit: 'GiB',
},
{
- base: 1048576,
+ base: 1024 ** 2,
unit: 'MiB',
},
{
},
];
+const CWL_SIZE = {
+ base: 1024 ** 2,
+ unit: 'MiB',
+};
+
export const formatPropertyValue = (
pv: PropertyValue,
vocabulary?: Vocabulary
return '';
};
-export const formatContainerCost = (cost: number): string => {
+export const formatCost = (cost: number): string => {
const decimalPlaces = 3;
const factor = Math.pow(10, decimalPlaces);