1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
if (ofp != NULL) {
if (outYr < 0)
outYr = abs(outYr);
fprintf(ofp, "%i", outYr);
fprintf(ofp, "%s", ".");
if (outMo > 9)
fprintf(ofp, "%i", outMo);
else {
fprintf(ofp, "%i", 0);
fprintf(ofp, "%i", outMo);
}
if (outDa > 9)
fprintf(ofp, "%i", outDa);
else {
fprintf(ofp, "%i", 0);
fprintf(ofp, "%i", outDa);
}
fprintf(ofp, "%s", ".");
if (outHr > 9)
fprintf(ofp, "%i", outHr);
else {
fprintf(ofp, "%i", 0);
fprintf(ofp, "%i", outHr);
}
if (outMin > 9)
fprintf(ofp, "%i", outMin);
else {
fprintf(ofp, "%i", 0);
fprintf(ofp, "%i", outMin);
}
fprintf(ofp, "%s", " ");
fileFormatOffset = 0;
tempLong2 = 0;
if (tm2_accMove < 10)
{
fileFormatOffset = 5;
}
else if (tm2_accMove < 100)
{
fileFormatOffset = 4;
}
else if (tm2_accMove < 1000)
{
fileFormatOffset = 3;
}
else if (tm2_accMove < 10000)
{
fileFormatOffset = 2;
}
else if (tm2_accMove < 100000)
{
fileFormatOffset = 1;
}
else
{
fileFormatOffset = 0;
}
for (int j = 0; j < fileFormatOffset; j++)
fprintf(ofp, "%s", " ");
tempLong2 = floor(tm2_accMove * 10000) / 10000;
fprintf(ofp, "%.4f", tempLong2);
fprintf(ofp, "%s\n", "");
}
|