私のコード:
std::vector<double> thePoint(4);
thePoint[0] = 86;
thePoint[1] = -334.8836574;
thePoint[2] = 24.283;
thePoint[3] = 345.67675;
ofstream file1(tempFileName, ios::trunc);
file1 << std::setprecision(16) << thePoint[0] << " ";
file1 << std::fixed << std::setprecision(2) << thePoint[1] << " ";
file1 << std::setprecision(16) << thePoint[2] << " ";
file1 << std::setprecision(16) << thePoint[3];
私は得る:
86 -334.88 24.28300000000000 345.6767500000000
私が欲しい:
86 -334.88 24.283 345.67675
他の厄介なコードとのインターフェースには、奇妙なフォーマットが必要です。