Skip to content

Commit cc5c1dd

Browse files
committed
fix(FR-819): Fix share unit of resource preset.
1 parent 4c1d325 commit cc5c1dd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

react/src/components/ResourcePresetSettingModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { convertBinarySizeUnit } from '../helper';
1+
import {
2+
convertBinarySizeUnit,
3+
toFixedFloorWithoutTrailingZeros,
4+
} from '../helper';
25
import { useSuspendedBackendaiClient } from '../hooks';
36
import { useResourceSlots, useResourceSlotsDetails } from '../hooks/backendai';
47
import { useCurrentProjectValue } from '../hooks/useCurrentProject';
@@ -108,6 +111,9 @@ const ResourcePresetSettingModal: React.FC<ResourcePresetSettingModalProps> = ({
108111
if (_.includes(key, 'mem')) {
109112
return convertBinarySizeUnit(value, 'b', 0)?.numberFixed;
110113
}
114+
if (_.includes(key, '.shares')) {
115+
return toFixedFloorWithoutTrailingZeros(value, 2);
116+
}
111117
return value;
112118
},
113119
);

0 commit comments

Comments
 (0)