use Math::Round; $Math::Round::half = 0.5; say nearest(0.01, '0.05499999999999999334');