Matches JS Math.round(x) including negative .5 tie-breaking toward +infinity.
Math.round(x)
.5
@pragma('vm:prefer-inline') int roundJs(num x) => (x + 0.5).floor();