double d = 123.45;

QString str = QString::number(d, 'f', 3);//转换为QString

qDebug() << str;  //输出 123.450

QT中怎样指定小数位数

QT中怎样指定小数位数

相关文章: