PDA

View Full Version : writting 'commas' in Fortran


wallacesg
04-18-2009, 11:32 AM
Hi
I need some help about this subject: fortran writes float numbers [ at least in default configuration ] like this :
3.54593E-008 (1)
and I need an output file that could be opened by OpenOfficeCalc, which reads numbers like this:
3,54593E-008 (2)
So, I need :
a ) change Fortran configuration to make it write commas in order of dots
b ) a new program that inputs (1) and outputs (2) ( if really that exists ... )
c ) maybe change OOC's configuration for making it read numbers written with dots

I have an 12 x 1200 data output file, I cant do it by myself , and I have no idea how solve this problem...

Thanks

tzeis
05-01-2009, 01:46 AM
I am not aware of any format specifier to change the decimal designator from a period to a comma. This pretty much means that you will have to come up with something yourself.
I can think of three possibilities -
1) Try the internet to see if anyone has solved the problem and posted the solution.
2) Write a function that accepts a real number as an argument and returns a character representation of the number with the period replaced with a comma, and write the character variable to the file instead of the real variable.
3) Write a script to post process the data file after it has been written.

wallacesg
05-14-2009, 07:46 PM
I've found a solution. I'll write it here if it colud be of any use for anybody;
well, really it was not me but a mate of mine; what he did was 'just' change PC's advanced configuration in order to make it understand "." in order of "," and "," in order of "." (Panel de configuracion/Reloj idioma y rregion/formato/personalizar el formato ) in spanish version of W.Vista
we changed it, made the work at OOC and once finished returned to default configuration
wow!! hehehe

bye :)