How to increase the precision of float values to more than 10 in python? -
this question has answer here:
daily_raw_consumption = float(daily_rate) * float(rep_factor)
float(daily_raw_consumption)
by default rep_factor getting converted precision of 10 values. ex:
actual: 60.8333333333
what need : 60.833333333333333333
is possible modify precision without converting decimal
consider using decimal instead of float
from decimal import * daily_raw_consumption = decimal(daily_rate) / decimal(rep_factor) print(decimal(daily_raw_consumption))
Comments
Post a Comment