I'm writing a front end gui in Python3.2, and part of the final output is based off of a fortran format. I've found a good few examples, and haven't had many problems translating from fortran to python (e.g. F10.3 == "{:10.3F}")
However, I'm seeing some differences in some of the example output my python is trying to mimic.
Where the fortran code contains elements such as F10.0, F9.0, .... I see user supplied data on the example output file such as 345.2300 or just 0.0000. Is it not true that .0 implies no decimals? Shouldn't 345.2300 become just 345? I find this to be true in python, it will automatically round up any decimals supplied, and F10.0 would essentially be a 10 digit Integer. Is there a slight difference in Fortran that I don't understand? Does a supplied decimal number override the format code in Fortran? Or is my understanding of the format specification correct and there is some issue in the code/output I'm trying to create in python.
I know basically nothing of fortran, so any help would be very appreciated
Thanks, -Chris
EDIT I'm starting to realize that maybe I'm misinterpreting my specifications for this gui. My gui generates a text file which is fed to another program written in Fortran. The text file must be in a very specific format, which is dictated by (from the manual) fortran format statements. In the example text files that I have, I can see a user typed 29.64578 for one of the variables, and according to the specifications, this will be matched with F10.0. However, the text file contains a string 10 in width, " 29.64578". In my python version, if a user typed 29.64578 and I used "{:10.0F}", the text file would show " 30".
Should I be translating F10.0 to "{:10.0G}" instead of "{:10.0F}" in my python?
Will 29.64578 not cause an error when matched with F10.0 in fortran?
What would the fortran code do with 29.64578, assuming F10.0?