Originally Posted By: Pork
This is great acidburn!
Got it working with minor changes for filenames and formatting.
I added a printf to try and confirm the writing, but it isn't working out like I expected. Here's the .csv line:
20120102 024400,1.04098,1.04108,1.04098,1.04102,0
here's the printf statement:
printf("\n %f %f %f %f %f",tick.time,tick.fOpen,tick.fHigh,tick.fLow,tick.fClose);
here's the results:
40910.113889 0.010380 0.010376 0.000000 0.000000
The time appears to be OK. the values, not so much.
Is there a better way to confirm the writing?
Thanks,
P


Ah, that is strange, yes. Lost half an hour myself, trying to debug that weird issue. Printf format %f expects double, not float! I believe standard C would promote floats to doubles behind your back, but Lite-C doesn't. So you can get the correct output by manually casting all the floats on the right. Like this:

Code:
printf("\n %f %f %f %f %f", (double) tick.time, (double) tick.fOpen...



At least that's how I workaround the same issue.