Jak zaokrąglić do 3 znaczących postaci w Pythonie
rounded_number = round(a_number, significant_digits - int(math.floor(math.log10(abs(a_number)))) - 1)
Mysterious Moth
rounded_number = round(a_number, significant_digits - int(math.floor(math.log10(abs(a_number)))) - 1)
>>> round(1234, -3)
1000.0