perl -e "$f=1.567E-09;printf qq{ '%s' is '%8.3g'$/}, $f, $f;"
'1.567e-009' is '1.57e-009'
perl -e "$f=1.567E-09;printf qq{ '%s' is '%8.3G'$/}, $f, $f;"
'1.567e-009' is '1.57E-009'
If you need to force only two digits on the exponent you might have to resort to an RE? In reply to Re: formatting text with E-XX
by shenme
in thread formatting text with E-XX
by kommesel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |