Skip to content

Commit a9c3c51

Browse files
committed
reading float in entity-value-control and apply decimals
1 parent a8a234f commit a9c3c51

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modbus2mqtt/angular",
3-
"version": "0.12.18",
3+
"version": "0.12.19",
44
"sshserver": "odroid@homeassistant.lan",
55
"credits": "multiple choice by Studio 365 from <a href='https://thenounproject.com/browse/icons/term/multiple-choice/' target='_blank' title='multiple choice Icons'>Noun Project</a> (CC BY 3.0)",
66
"scripts": {

src/app/specification/entity-value-control/entity-value-control.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class EntityValueControlComponent
144144
switch (this.entity.converter.name) {
145145
case "number":
146146
if (this.entity.mqttValue != undefined)
147-
this.numberFormControl.setValue(this.getMqttValue() as number);
147+
this.numberFormControl.setValue(parseFloat(Number.parseFloat((this.getMqttValue() as number).toString()).toFixed((this.entity.converterParameters as Inumber).decimals)));
148148
let num = this.entity.converterParameters as Inumber;
149149
if (num != undefined) {
150150
if (num.step) this.step = num.step;

0 commit comments

Comments
 (0)