roundJs function

int roundJs(
  1. num x
)

Matches JS Math.round(x) including negative .5 tie-breaking toward +infinity.

Implementation

@pragma('vm:prefer-inline')
int roundJs(num x) => (x + 0.5).floor();