param number param places returns export function roundToPlaces ( number , places ) { const multiplier = Math . pow ( 10 , places ) ; return Math . round ( number * multiplier ) / multiplier ; } param number param lower param upper returns export function clamp ( number , lower , upper ) { if ( number < lower ) { return lower ; } if ( number > upper ) { return upper ; } return number ; }