perl win32 & output of printf

V

vp

Hi all,
In Perl win32 (ActivePerl v5.8.3), when I use

printf "%8d %15.6E\n", $x, $y;

I got always:

100207 -8.000000E+002

With the same script, under Linux & HP-UX, I got:

100207 -8.000000E+02

How I could tell Perl win32 that I need only two numbers for exposant (E+02 instead of E+002) ?

Thank you,
Regards,
 
S

Sisyphus

vp said:
Hi all,
In Perl win32 (ActivePerl v5.8.3), when I use

printf "%8d %15.6E\n", $x, $y;

I got always:

100207 -8.000000E+002

With the same script, under Linux & HP-UX, I got:

100207 -8.000000E+02

How I could tell Perl win32 that I need only two numbers for exposant
(E+02 instead of E+002) ?

You can't. According to 'perldoc -f sprintf' this behaviour is system
dependent.

Cheers,
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,163
Messages
2,570,897
Members
47,434
Latest member
TobiasLoan

Latest Threads

Top