This is a discussion on Variable Type issue within the Windows Programming forums, part of the Platform Specific Boards category; Originally Posted by Elysia Just pass %f, and it will print any available decimals. Beware that floating points in somewhat ...
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
I know, I didn't think of that, but I think the point was that a division with 1 and 8 would in real life give 0.125. So if done "correctly" in C/C++, it should be 0.125 too (and not 0.12500001).
For information on how to enable C++11 on your compiler, look here.
Thx everyone for help...
Just for record I solved it by putting into the calculator a slide-bar by which a user selects how many decimals does he want... Useful because it automatically rounds up decimals
I use _snprintf() as it is safer and less likely to crash your app than sprintf()
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
"If you are going through hell....keep going."