I have this query in my C++ code:
query << "UPDATE currency SET value= " << currencyValue
currencyValue is defined as “const double& currencyValue” and when I watch the value is
0.00045545105422339915
But if I check the value of the query then I get something like this
UPDATE currency SET value = 0.000455451
so decimals get missing…
Any ideas why?
You can try calling setprecision(10) (or any value you actually want) on your stream before outputting the double value to it.
You can do it like this: