Closed Kayya886 closed 2 years ago
Hi @brendanarnold, I'm running into this same bug.
In FORTRAN when I format a float with 0 precision, like "f6.0", I get the number with a decimal with no trailing numbers.
Example:
program printformat
implicit none
real :: number
number = 99999.01
Print "(f6.0)", number
end program printformat
OUT:
99999.
But in Python with fortranformt when I try the same formatting, I get ******
from fortranformat import FortranRecordWriter
record_line = FortranRecordWriter("f6.0")
record_line.write([99999.01])
OUT:
'******'
Which version are you using? I've tried to recreate locally and it seems to work
Sorry, my bad that test was actually after I had applied some local changes - verified a bug
Fix is now in 1.1.0
method _compose_float_string() in file _output.py (line: 219) this fix will cause error .write method output of a FotranFormatWritter('Fx.0')
if (d == 0): return '' w