make sure we use a reasonable number of decimal points for converted temps.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Pipe, PipeTransform } from '@angular/core';
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
import {formatNumber} from "@angular/common";
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'temperature'
|
name: 'temperature'
|
||||||
@@ -21,9 +22,9 @@ export class TemperaturePipe implements PipeTransform {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if(includeUnits){
|
if(includeUnits){
|
||||||
return convertedTemp + convertedUnitSuffix
|
return formatNumber(convertedTemp, 'en-US') + convertedUnitSuffix
|
||||||
} else {
|
} else {
|
||||||
return convertedTemp
|
return formatNumber(convertedTemp, 'en-US',)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user