projects
/
arvados-workbench2.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f9a41a0
)
13494: Fixes edge case on file size formatter.
author
Lucas Di Pentima <lucas@di-pentima.com.ar>
Thu, 12 Nov 2020 15:27:24 +0000
(12:27 -0300)
committer
Lucas Di Pentima <lucas@di-pentima.com.ar>
Thu, 12 Nov 2020 15:27:24 +0000
(12:27 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>
src/common/formatters.ts
patch
|
blob
|
history
diff --git
a/src/common/formatters.ts
b/src/common/formatters.ts
index 55fb050738af1d670984b9c6b38cc3f8bafb7ddc..17917127f1c26ac18221f8b34a2efcfd6413da5f 100644
(file)
--- a/
src/common/formatters.ts
+++ b/
src/common/formatters.ts
@@
-22,6
+22,8
@@
export const formatDate = (isoDate?: string | null, utc: boolean = false) => {
export const formatFileSize = (size?: number) => {
if (typeof size === "number") {
+ if (size === 0) { return "0 B"; }
+
for (const { base, unit } of FILE_SIZES) {
if (size >= base) {
return `${(size / base).toFixed()} ${unit}`;