aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/formatter.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/common/formatter.js')
-rw-r--r--modern/src/common/formatter.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js
index 9a61b178..8ad87e70 100644
--- a/modern/src/common/formatter.js
+++ b/modern/src/common/formatter.js
@@ -1,4 +1,5 @@
import moment from 'moment';
+import t from '../common/localization';
const formatValue = (key, value) => {
switch (key) {
@@ -13,7 +14,13 @@ const formatValue = (key, value) => {
case 'batteryLevel':
return value + '%';
default:
- return value;
+ if (typeof value === 'number') {
+ return Number(value.toFixed(1));
+ } else if (typeof value === 'boolean') {
+ return value ? t('sharedYes') : t('sharedNo');
+ } else {
+ return value;
+ }
}
}