1 QRegExp rx; 2 rx.setPattern("(\\.){0,1}0+$"); 3 double double01 = 15648.120000; 4 double double02 = 15648.000000 5 QString ceshi01 = QString("%1").arg(double01,0,'f',-1).replace(rx,""); 6 QString ceshi02 = QString("%1").arg(double02,0,'f',-1).replace(rx,"");
碰到需求了,做个笔记