round<T extends num> function

T round<T extends num>(
  1. T value,
  2. num nearest
)

Rounds value to the nearest nearest.

Implementation

T round<T extends num>(T value, num nearest) =>  nearest == 1 ? value : (value / nearest).round() * nearest as T;