diff options
Diffstat (limited to 'modern/src/common/formatter.js')
-rw-r--r-- | modern/src/common/formatter.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js index 0ff4e74..22d1654 100644 --- a/modern/src/common/formatter.js +++ b/modern/src/common/formatter.js @@ -49,12 +49,12 @@ export const formatDistance = (value, unit, t) => { export const formatSpeed = (value, unit, t) => { switch (unit) { case 'kmh': - return `${(value * 1.852).toFixed(2)} ${t('sharedKmh')}`; + return `${(value * 1.852).toFixed(0)} ${t('sharedKmh')}`; case 'mph': - return `${(value * 1.15078).toFixed(2)} ${t('sharedMph')}`; + return `${(value * 1.15078).toFixed(0)} ${t('sharedMph')}`; case 'kn': default: - return `${(value * 1).toFixed(2)} ${t('sharedKn')}`; + return `${(value * 1).toFixed(0)} ${t('sharedKn')}`; } }; @@ -70,7 +70,10 @@ export const formatVolume = (value, unit, t) => { } }; -export const formatHours = (value) => moment.duration(value).humanize(); +export const formatHours = (value, t) => { + moment.locale('es'); + return `${moment.duration(value).asHours().toFixed(0)} ${t('sharedHours')}`; +} export const formatCoordinate = (key, value, unit) => { let hemisphere; |