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 0b5c0b8 commit d260b32Copy full SHA for d260b32
src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.ts
@@ -1,5 +1,7 @@
1
import { Pipe, PipeTransform } from '@angular/core';
2
import * as moment from 'moment';
3
+
4
+let FIXED_POINT_DIGITS 1;
5
@Pipe({
6
name: 'substractDateDisplayAsFloat'
7
})
@@ -14,7 +16,7 @@ export class SubstractDatePipeDisplayAsFloat implements PipeTransform {
14
16
const startDate = moment(substractDate);
15
17
const endDate = moment(fromDate);
18
const duration = this.getTimeDifference(startDate, endDate);
- return duration.asHours().toFixed(1).toString();
19
+ return duration.asHours().toFixed(FIXED_POINT_DIGITS).toString();
20
}
21
22
getTimeDifference(substractDate: moment.Moment, fromDate: moment.Moment): moment.Duration {
0 commit comments