I've seen the solutions around but they mostly round up to two significant figures and not down
I have tried these few methods
import math v = 0.000129 math.floor(v*100)/100 -output- 0.0 or
v = 0.000129 from decimal import Decimal float(f"{Decimal(f'{v:.2g}'):f}") -output- 0.00013 As you can see, I want to have two significant figures but do not want them rounded up. Decimal works to give the two sig figs but it rounds up while math just simply gives me 0.
i.e. a few to test
1999 -> 1900 29901 - > 29000 0.0199 -> 0.019 Thanks!