[Qt-interest] string to float

Stephen Jackson spjackson42 at gmail.com
Wed Jan 27 10:14:47 CET 2010


2010/1/27  yanqzhi:
>
> hi,
>
> When a string converts to a float, the float returned does't exactly match
> the string;
>
>  QString str("57.130");
>  float a = str.toFloat();
>
> the float is 57.130001.
>

http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.16

--
Hope this helps,

Stephen Jackson




More information about the Qt-interest-old mailing list