How to round to nearest int when casting float to int in go

int(f+0.5) will cause for it to round upwards if it’s >= .5

Leave a Comment