![]() |
Problem with saving REAL type to txt file
I have one little problem related to my post from yesterday.
I had to save a .txt file with spreadsheet data and that works fine, but the problem is that my macro doesn't save REAL type with decimal point but it saves like it is integer. Example: if one cell has value 50.0, and I load the cell into a Single type variable, when saved, it appears in txt file like 50 instead of 50. or 50.0 That's sort of problem, because it's input file for a old fortran application which needs REAL type at that field. |
Problem with saving REAL type to txt file
"Domagoj Vulin" wrote in message ... I have one little problem related to my post from yesterday. I had to save a .txt file with spreadsheet data and that works fine, but the problem is that my macro doesn't save REAL type with decimal point but it saves like it is integer. Example: if one cell has value 50.0, and I load the cell into a Single type variable, when saved, it appears in txt file like 50 instead of 50. or 50.0 That's sort of problem, because it's input file for a old fortran application which needs REAL type at that field. Solved, not quite elegant, so if someone has real solution of a problem... Function MakeDecimal(MyValue) If InStr(1, LTrim$(Str(MyValue)), ".") = 0 Then MakeDecimal= LTrim$(Str(MyValue)) & "." End If End Function The point is that in txt. file all is string. |
All times are GMT +1. The time now is 04:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com