UNPKG
decompose-dommatrix
Version:
latest (1.1.0)
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
A small library to decompose a DOMMatrix into transform values.
ismailman/decompose-dommatrix
decompose-dommatrix
/
roundToThreePlaces.mjs
10 lines
(7 loc)
•
275 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
/* from https://github.com/facebook/react-native/blob/master/Libraries/Utilities/MatrixMath.js */
export
default
function
roundToThreePlaces
(
number
){
const
arr =
number
.
toString
().
split
(
'e'
);
return
Math
.
round
(arr[
0
] +
'e'
+ (arr[
1
] ? +arr[
1
] -
3
:
3
)) *
0.001
; }