Skip to content

Commit

Permalink
fix: don't round unknown units of measurement closes #481
Browse files Browse the repository at this point in the history
  • Loading branch information
slipx06 committed Jun 19, 2024
1 parent 06bb90b commit a13b51e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sunsynk-power-flow-card",
"version": "4.43.0",
"version": "4.43.1",
"description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.",
"main": "sunsynk-power-flow-card.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Utils {
if (isNaN(numberValue)) return 0;

const rules = unitOfEnergyConversionRules[unit];
if (!rules) return `${Math.round(numberValue)} ${unit}`;
if (!rules) return `${numberValue.toFixed(decimal)} ${unit}`;

if (unit === UnitOfPower.WATT && Math.abs(numberValue) < 1000) {
return `${Math.round(numberValue)} ${unit}`;
Expand Down

0 comments on commit a13b51e

Please sign in to comment.