QString QString::number ( double n, char format = 'g', int precision = 6 ) [static]
Returns a string equivalent of the number n, formatted according to the specified format and precision. See Argument Formats for details.
Unlike QLocale::toString(), this function does not honor the user's locale settings.
See also setNum() and QLocale::toString().
所以,如下
- double data = 3.1415926 ;
- QString fromDouble = QString::number(data);
[ 此帖被cutemmll在2011-05-10 18:15重新编辑 ]