Remove unnecessary white space
if value is 0, do not represent as `N/A`
}
formatPercentage(format, value) {
- if (!value) {
+ if (value === undefined || value === null) {
return 'N/A';
}
}
}
- formatMemoryInByte(format, value) {
- value = value || 0;
- if (value < 1024) {
- return `${value.toFixed(1)}B `;
- } else if (value < 1048576) { // 1024 * 1024
- return `${(value / 1024).toFixed(1)}K `;
- } else if (value < 1073741824) { // 1024 * 1024 * 1024
- return `${(value / 1048576).toFixed(2)}M `;
- } else {
- return `${(value / 1073741824).toFixed(3)}G `;
- }
- }
-
formatMemory(format, value) {
value = value || 0;
if (value < 1024) {
