diff --git a/src/app/battery/battery.component.html b/src/app/battery/battery.component.html index e80e31c..132d185 100644 --- a/src/app/battery/battery.component.html +++ b/src/app/battery/battery.component.html @@ -32,7 +32,7 @@

{{b.name}}

{{b.history[0].percentage * 100}}%
- {{b.history[0].temp}} °C + {{round(b.history[0].temp)}} °C
Charging: {{b.history[0].charging}} diff --git a/src/app/battery/battery.component.ts b/src/app/battery/battery.component.ts index ddfb4ea..ee2df3a 100644 --- a/src/app/battery/battery.component.ts +++ b/src/app/battery/battery.component.ts @@ -22,4 +22,8 @@ export class BatteryComponent { }; constructor(public batteryService: BatteryService) { } + + round(num: number) { + return Math.round(num * 10) / 10; + } }