round static method

num round(
  1. double value, [
  2. bool keepDouble = true
])

Rounds the valueup or down to the nearest integer and returns the value. Parameter keepDouble enforces the return type to be double.

Implementation

@pragma("vm:prefer-inline")
static num round(double value, [bool keepDouble = true]) {
  return keepDouble ? value.roundToDouble() : value.round();
}