I am getting an issue when trying to output my float using std::cout <<
I have the following values:
vector2f = {-32.00234098f, 96.129380f} //takes 2 floats (x, y) output: -32.0023:96.1294 What I am looking for is:
output: -32.00234098:96.129380 The actual numbers could be vary from the 7 decimal places (.0000007) to 3 decimal places (.003) so setting a fixed rounding number does not work in this case.
Any help would be great as I have tried changed to doubles as well but to no avail.
Thanks in advance!
std::fixedoutput manipulator. (And possibly thestd:setprecision()manipulator too.)floatis only accurate to about 7 decimal digits not 7 decimal places. Your required output is 10 and 8 digits respectively so there will be rounding/inaccuracy.long double, it has more decimal digits thanfloatanddouble.