Hi,
When I do this:
Qt Code:
float frty = forty.toFloat(); printf("%f\n", frty);To copy to clipboard, switch view to plain text mode
I get:
40.099998
Why don't I get 40.1? I'm very thankful for any ideas.
Thanks!
Hi,
When I do this:
Qt Code:
float frty = forty.toFloat(); printf("%f\n", frty);To copy to clipboard, switch view to plain text mode
I get:
40.099998
Why don't I get 40.1? I'm very thankful for any ideas.
Thanks!
There's nothing wrong with QString::toFloat(), it's result of casting your value to double inside printf. Some more info here.
Try this
Oleg Shparber
timmu (15th December 2011)
Bookmarks