Skip to content

Instantly share code, notes, and snippets.

@kzinmr
Created November 1, 2018 01:37
Show Gist options
  • Save kzinmr/5f8ea3699466e57c04d7bf749bef771d to your computer and use it in GitHub Desktop.
Save kzinmr/5f8ea3699466e57c04d7bf749bef771d to your computer and use it in GitHub Desktop.
import math
def round_float(n, precision=3):
factor = 10**precision
return math.ceil(v * factor) / factor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment