diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-20 18:22:36 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-20 18:22:36 -0700 |
commit | b124908d9f9f2a24963871cac982cc5b5e172ba5 (patch) | |
tree | 87ccaa2cbb104af3547dab06703821fe48c4bc00 /modern/src/common/formatter.js | |
parent | b2cd88bbbad82654057cec8aec7415a8caca667e (diff) | |
download | trackermap-web-b124908d9f9f2a24963871cac982cc5b5e172ba5.tar.gz trackermap-web-b124908d9f9f2a24963871cac982cc5b5e172ba5.tar.bz2 trackermap-web-b124908d9f9f2a24963871cac982cc5b5e172ba5.zip |
Implement simple users screen
Diffstat (limited to 'modern/src/common/formatter.js')
-rw-r--r-- | modern/src/common/formatter.js | 9 |
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; + } } } |