Skip to content

Commit d260b32

Browse files
committed
refactor: TTA-196 number of fixed digits as constant with name
1 parent 0b5c0b8 commit d260b32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Pipe, PipeTransform } from '@angular/core';
22
import * as moment from 'moment';
3+
4+
let FIXED_POINT_DIGITS 1;
35
@Pipe({
46
name: 'substractDateDisplayAsFloat'
57
})
@@ -14,7 +16,7 @@ export class SubstractDatePipeDisplayAsFloat implements PipeTransform {
1416
const startDate = moment(substractDate);
1517
const endDate = moment(fromDate);
1618
const duration = this.getTimeDifference(startDate, endDate);
17-
return duration.asHours().toFixed(1).toString();
19+
return duration.asHours().toFixed(FIXED_POINT_DIGITS).toString();
1820
}
1921

2022
getTimeDifference(substractDate: moment.Moment, fromDate: moment.Moment): moment.Duration {

0 commit comments

Comments
 (0)