Skip to content

Commit

Permalink
Fix rounding method
Browse files Browse the repository at this point in the history
  • Loading branch information
tan75 committed Sep 8, 2021
1 parent fab44f9 commit 88bc1e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/_lib/roundingMethods/index.ts
Expand Up @@ -8,11 +8,11 @@ const RoundingMap: RoundingFnsMap = {
ceil: Math.ceil,
round: Math.round,
floor: Math.floor,
trunc: (value: number) => value < 0 ? Math.ceil(value) : Math.floor(value), // Math.trunc is not supported by IE
trunc: (value: number) => (value < 0 ? Math.ceil(value) : Math.floor(value)), // Math.trunc is not supported by IE
}

export function getRoundingMethod(method: RoundingMethod) {
return RoundingMap[method]
}

export const defaultRoundingMethod : RoundingMethod = 'trunc'
export const defaultRoundingMethod: RoundingMethod = 'trunc'

0 comments on commit 88bc1e4

Please sign in to comment.