UNPKG
@shopify/flash-list
Version:
alpha (2.0.0-alpha.7)
latest (1.8.0)
2.0.0-alpha.7
2.0.0-alpha.6
2.0.0-alpha.5
2.0.0-alpha.4
2.0.0-alpha.3
2.0.0-alpha.2
2.0.0-alpha.1
1.8.0
1.7.6
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.7.0
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.0
1.4.3
1.4.2
1.4.1
1.4.0
1.3.1
1.3.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.4
1.0.3
1.0.2
1.0.1
FlashList is a more performant FlatList replacement
shopify.github.io/flash-list/
Shopify/flash-list
@shopify/flash-list
/
src
/
benchmark
/
roundToDecimalPlaces.ts
5 lines
(4 loc)
•
175 B
text/typescript
View Raw
1
2
3
4
5
export
function
roundToDecimalPlaces
(
value
:
number
,
decimalPlaces
:
number
) {
const
multiplier =
10
** decimalPlaces;
return
Math
.
round
(value * multiplier) / multiplier; }