Round battery temperature

This commit is contained in:
Zakary Timson 2018-11-15 13:04:26 -05:00
parent bdade31d4e
commit edfdad1547
2 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,7 @@
<h3>{{b.name}}</h3> <h3>{{b.name}}</h3>
{{b.history[0].percentage * 100}}% {{b.history[0].percentage * 100}}%
<br> <br>
{{b.history[0].temp}} °C {{round(b.history[0].temp)}} °C
<br> <br>
Charging: {{b.history[0].charging}} Charging: {{b.history[0].charging}}
</mat-card> </mat-card>

View File

@ -22,4 +22,8 @@ export class BatteryComponent {
}; };
constructor(public batteryService: BatteryService) { } constructor(public batteryService: BatteryService) { }
round(num: number) {
return Math.round(num * 10) / 10;
}
} }