toDecimal

toDecimal will round a number to the specified decimal place.

Import

import { toDecimal } from '@popmotion/popcorn';

Usage

toDecimal(3.3333); // 3.33
toDecimal(6.6666, 1); // 6.67

Types

toDecimal(value: number, precision: number = 2): number