自定义小数点和千位分隔符

QString str = QString("%L1").arg(yourDouble);

据说可以,但是怎么用还没搞懂

const QLocale & cLocale = QLocale::c();
QString ss = cLocale.toString(yourDoubleNumber, 'f');
ss.replace(cLocale.groupSeparator(), yourGroupChar);
ss.replace(cLocale.decimalPoint(), yourDecimalPointChar);

 

posted @ 2021-10-27 17:25  浅笑19  阅读(130)  评论(0编辑  收藏  举报