Qt double float保留两位小数

 

Qt double  float保留两位小数

 

double p9_d = P9_Value.toDouble();
float p9_f = P9_Value.toFloat();
QString p9_str2 = QString::number(p9_f, 'f', 2);

P9_Value = p9_str2.append("h");

 

 

 

 

 

 

 

####################

posted @ 2021-06-23 21:29  西北逍遥  阅读(3757)  评论(0编辑  收藏  举报