G'day Dr Manhattan,
Saying "is not very useful" is not very useful to us. What format would you find useful? sprintf may do what you want; its documentation has copious examples. Here's a few possibilities:
$ perl -Mstrict -Mwarnings -le ' my $x = 9**-10; print "$x"; print sprintf "%f" => $x; print sprintf "%.15f" => $x; print sprintf "%.31f" => $x; print sprintf "%g" => $x; print sprintf "%.15g" => $x; print sprintf "%.31g" => $x; ' 2.86797199079244e-10 0.000000 0.000000000286797 0.0000000002867971990792441349306 2.86797e-10 2.86797199079244e-10 2.86797199079244134930566254989e-10
-- Ken
In reply to Re: Printing a very small number
by kcott
in thread Printing a very small number
by Dr Manhattan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |