We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e5d154 commit e2a6ea8Copy full SHA for e2a6ea8
src/utils.ts
@@ -44,7 +44,7 @@ export function normalizeStateValue(
44
state: number,
45
unit_of_measurement?: string,
46
): { state: number; unit_of_measurement?: string } {
47
- const validState = Math.max(0, state);
+ const validState = Math.max(0, state) || 0; // the 0 check is for NaN
48
if (!unit_of_measurement || unit_of_measurement == 'monetary') {
49
return { state: validState, unit_of_measurement };
50
}
0 commit comments