diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2020-11-13 12:49:51 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2020-11-13 12:49:51 +0530 |
commit | 2ef17f32bf99e4e823ad3622227a8f41af798d65 (patch) | |
tree | 00c0c165207af8f677e544cf814f478833ef27ec /modern/src/common | |
parent | 651dfa0ca0626a47c684077ab39feeade177a28d (diff) | |
download | trackermap-web-2ef17f32bf99e4e823ad3622227a8f41af798d65.tar.gz trackermap-web-2ef17f32bf99e4e823ad3622227a8f41af798d65.tar.bz2 trackermap-web-2ef17f32bf99e4e823ad3622227a8f41af798d65.zip |
Implementing Stops Report
Diffstat (limited to 'modern/src/common')
-rw-r--r-- | modern/src/common/formatter.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js index 52c05c0d..72216186 100644 --- a/modern/src/common/formatter.js +++ b/modern/src/common/formatter.js @@ -67,6 +67,18 @@ export const formatSpeed = (value, unit) => { } }; +export const formatVolume = (value, unit) => { + switch (unit) { + case 'impGal': + return `${(value / 4.546).toFixed(2)} ${t('sharedGallonAbbreviation')}`; + case 'usGal': + return `${(value / 3.785).toFixed(2)} ${t('sharedGallonAbbreviation')}`; + case 'ltr': + default: + return `${(value / 1).toFixed(2)} ${t('sharedLiterAbbreviation')}`; + } +} + export const formatHours = (value) => { return moment.duration(value).humanize(); }; |