Is there anyway to set the "default" number of significant figures for python floats or numpy floats?
I hate wrapping the 100+ print statements I have with custom rounding code, that sucks.
Is there anyway to set the "default" number of significant figures for python floats or numpy floats?
I hate wrapping the 100+ print statements I have with custom rounding code, that sucks.
There are few ways to approach the problem.
def print(args): builtins.print(("%.2f" % a if isinstance(a, float) else a for a in args))