UNPKG

symmetric-round

Version:

A tiny utility function to perform symmetric rounding (a.k.a. "commercial rounding") on a number.

4 lines (2 loc) 79 B
'use strict'; module.exports = (x) => Math.round(Math.abs(x)) * Math.sign(x);