how to round nearest gram

1 answer

if the fractional part is at least 0.5, round up
if under 0.5, round down