I don't know because you won't answer my question.
%d is for INTEGERS (any).
try %1.10f for doubles (or floats or long doubles etc). 1.10 means 10 decimal places. 20 is more than most systems actually have so between 1.0 and 1.20 as you like it. There are also codes for scientific notation and more.
if its not a double/float/int type, tell me more.
printf uses a dumb pointer approach. whatever you stick in the variables, it takes a pointer to that address and then attempts to use that as if it were what you said it was. This can be useful to exploit, or it can cause bugs and crashes, depending on what you did to it. Mostly, you should stick to following the intentions of the tool until you understand it very well. And mostly, you should be using c++ tools, though I will use printf for bunches of doubles due to the formatting hassle of cout.