From f6d15a1a445a1abd18d89a803b8617957c6970b6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 9 May 2024 06:34:04 -0700 Subject: Fix number formatting --- src/common/util/formatter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/common/util/formatter.js b/src/common/util/formatter.js index 7b7fc96d..0463df2b 100644 --- a/src/common/util/formatter.js +++ b/src/common/util/formatter.js @@ -23,11 +23,11 @@ export const formatNumber = (value, precision = 1) => Number(value.toFixed(preci export const formatPercentage = (value) => `${value}%`; -export const formatTemperature = (value) => `${value}°C`; +export const formatTemperature = (value) => `${value.toFixed(1)}°C`; -export const formatVoltage = (value, t) => `${value} ${t('sharedVoltAbbreviation')}`; +export const formatVoltage = (value, t) => `${value.toFixed(2)} ${t('sharedVoltAbbreviation')}`; -export const formatConsumption = (value, t) => `${value} ${t('sharedLiterPerHourAbbreviation')}`; +export const formatConsumption = (value, t) => `${value.toFixed(2)} ${t('sharedLiterPerHourAbbreviation')}`; export const formatTime = (value, format, hours12) => { if (value) { -- cgit v1.2.3