Skip to content

Commit

Permalink
Display decimals only for MB and higher
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed Feb 17, 2020
1 parent f59ab0d commit f67763b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/files/src/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ export default {
if (int < 0) {
return ''
}

if (isNaN(int)) {
return '?'
}

const mb = 1048576

// TODO: Pass current language as locale to display correct separator
return filesize(int, {
round: 2
round: int < mb ? 0 : 1
})
},

Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/2986
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Display decimals in resource size column only for MBs or higher

We've stopped displaying decimals in resource size column for sizes smaller than 1 MB.
We've also started displaying only one decimal.

https://github.com/owncloud/phoenix/issues/2986
https://github.com/owncloud/phoenix/pull/3051

0 comments on commit f67763b

Please sign in to comment.