The problem is with the underlying C library's conversion function, not
Octave.
But you can do this (for positive exponents only):
x = 1.2345678910e+002;
ex = floor(log(x)/log(10));
y = x / 10**ex;
fprintf('%10.10f+%03d\n', y, ex)
=> 1.2345678910+002
Jakub Selesovsky wrote:
Hello,
I have a little problem with the fprintf function. For another
processing I need to have the results from octave in this form:
1.2345678910e+002
I am able to control the precision and the width of the column via
'%17.10e' but I don't know how to control the number of digits behind
letter 'e'. I am always getting the output with two digits (e+02) in
exponent, but I have to get three digits (e+002).
Than you for any help.
Jakub