$n = reverse scalar sprintf("%2.4f",$n); $n =~ s/^0+\.?//g; $n = reverse scalar $n;