From 363962df4706df3d198900a044a7e7cdb9240764 Mon Sep 17 00:00:00 2001 From: g Date: Mon, 27 Mar 2023 15:22:07 +0300 Subject: [PATCH] 2 decimal places in values --- src/Countries.jsx | 14 +++++++------- src/Regions.jsx | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Countries.jsx b/src/Countries.jsx index 1b0118c..6170549 100644 --- a/src/Countries.jsx +++ b/src/Countries.jsx @@ -202,7 +202,7 @@ export default function Countries({ mapOptions, onMapOptionClick }) { {currentTech.label} - {info[currentParameter.value].toFixed(1).replace(".", ",")} + {info[currentParameter.value].toFixed(2).replace(".", ",")} } @@ -222,7 +222,7 @@ export default function Countries({ mapOptions, onMapOptionClick }) { Солнечные электростанции - {info.static_power_fact_solar_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_solar_mw.toFixed(2).replace(".", ",")} } @@ -232,7 +232,7 @@ export default function Countries({ mapOptions, onMapOptionClick }) { Наземные ветроэлектростанции - {info.static_power_fact_onshore_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_onshore_mw.toFixed(2).replace(".", ",")} } @@ -242,7 +242,7 @@ export default function Countries({ mapOptions, onMapOptionClick }) { Офшорные ветроэлектростанции - {info.static_power_fact_offshore_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_offshore_mw.toFixed(2).replace(".", ",")} } @@ -252,7 +252,7 @@ export default function Countries({ mapOptions, onMapOptionClick }) { Всего ВИЭ (включая СЭС, ВЭС, ГЭС, БиоЭС, ГеоЭС) - {info.static_power_fact_res_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_res_mw.toFixed(2).replace(".", ",")} } @@ -262,7 +262,7 @@ export default function Countries({ mapOptions, onMapOptionClick }) { Доля всей ВИЭ-генерации в балансе мощности страны, % - {info.static_res_share_power.toFixed(1).replace(".", ",")} + {info.static_res_share_power.toFixed(2).replace(".", ",")} } @@ -272,7 +272,7 @@ export default function Countries({ mapOptions, onMapOptionClick }) { Доля СЭС и ВЭС в балансе мощности страны, % - {info.static_solar_wind_share_power.toFixed(1).replace(".", ",")} + {info.static_solar_wind_share_power.toFixed(2).replace(".", ",")} } diff --git a/src/Regions.jsx b/src/Regions.jsx index 494c9eb..1f29480 100644 --- a/src/Regions.jsx +++ b/src/Regions.jsx @@ -249,7 +249,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) { {currentTech.label}, {currentSupport.label} - {info[currentParameter.value].toFixed(1).replace(".", ",")} + {info[currentParameter.value].toFixed(2).replace(".", ",")} } @@ -268,7 +268,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) { Солнечные электростанции - {info.static_power_fact_solar_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_solar_mw.toFixed(2).replace(".", ",")} } @@ -278,7 +278,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) { Ветроэлектростанции - {info.static_power_fact_wind_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_wind_mw.toFixed(2).replace(".", ",")} } @@ -288,7 +288,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) { Малые гидроэлектростанции - {info.static_power_fact_shydro_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_shydro_mw.toFixed(2).replace(".", ",")} } @@ -298,7 +298,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) { Другие объекты ВИЭ-генерации - {info.static_power_fact_other_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_other_mw.toFixed(2).replace(".", ",")} } @@ -308,7 +308,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) { Всего ВИЭ - {info.static_power_fact_res_mw.toFixed(1).replace(".", ",")} + {info.static_power_fact_res_mw.toFixed(2).replace(".", ",")} } @@ -318,7 +318,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) { Доля всех ВИЭ в балансе мощности региона, % - {info.static_res_share_power.toFixed(1).replace(".", ",")} + {info.static_res_share_power.toFixed(2).replace(".", ",")} }