1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 06:19:41 +02:00
portainer/app/react/kubernetes/utils.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
192 B
TypeScript
Raw Normal View History

export function parseCpu(cpu: string) {
let res = parseInt(cpu, 10);
if (cpu.endsWith('m')) {
res /= 1000;
} else if (cpu.endsWith('n')) {
res /= 1000000000;
}
return res;
}