$x = 0+sprintf('%0.6f', $x) ; # 6 decimal places $x = 0+sprintf('%1.5e', $x) ; # 6 significant digits