RE: Format of %e output

2002-05-07 Thread Bob Showalter
> -Original Message- > From: Dan Fish [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 07, 2002 8:33 AM > To: [EMAIL PROTECTED] > Subject: Format of %e output > > > I've got this *really ancient* program (for which I naturally > don't have the

Re: Format of %e output

2002-05-07 Thread Felix Geerinckx
on Tue, 07 May 2002 12:33:15 GMT, [EMAIL PROTECTED] (Dan Fish) wrote: > Is there a way to force perl to output using the %e format with > only 2 exponent digits?? > I didn't find any. In the meantime, you could use a substitution: my $number = sprintf("%E", -0.0001); $number =~ s/(E[+-]

Format of %e output

2002-05-07 Thread Dan Fish
I've got this *really ancient* program (for which I naturally don't have the source :-) that parses reports and expects floating point numbers to be in the %e format with 2 exponent digits (I.E. 3.045E+06). I'm trying to feed it some output of my own from a perl script, but perl seems insistent