MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / convertSwapToBytes

Function convertSwapToBytes

vmm/ui/src/composables/useVmManager.ts:312–318  ·  view source on GitHub ↗
(value: number, unit: string)

Source from the content-addressed store, hash-verified

310 }
311
312 function convertSwapToBytes(value: number, unit: string) {
313 const mb = convertMemoryToMB(value, unit);
314 if (!Number.isFinite(mb) || mb <= 0) {
315 return 0;
316 }
317 return Math.max(0, Math.round(mb * BYTES_PER_MB));
318 }
319
320 function bytesToMB(bytes: number) {
321 if (!bytes) {

Callers 1

useVmManagerFunction · 0.85

Calls 1

convertMemoryToMBFunction · 0.85

Tested by

no test coverage detected