use note size format also in file properties

This commit is contained in:
zadam
2023-06-02 16:05:02 +02:00
parent a6ade790c6
commit 7e71029d1c
4 changed files with 25 additions and 16 deletions

View File

@@ -354,6 +354,17 @@ function escapeRegExp(str) {
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
}
function formatNoteSize(size) {
size = Math.max(Math.round(size / 1024), 1);
if (size < 1024) {
return `${size} KiB`;
}
else {
return `${Math.round(size / 102.4) / 10} MiB`;
}
}
export default {
reloadFrontendApp,
parseDate,
@@ -396,5 +407,6 @@ export default {
filterAttributeName,
isValidAttributeName,
sleep,
escapeRegExp
escapeRegExp,
formatNoteSize
};