How can I convert a number (double) to string, with custom decimal point and thousand separator chars?
I've seen QLocale, but I don't want to choose the localization country, but rather specify my own decimal point and thousand separator chars.
Thanks
解决方案
Qt doesn't support custom locale. But to deal with just group and decimal point characters is trivial:
const QLocale & cLocale = QLocale::c();
QString ss = cLocale.toString(yourDoubleNumber, 'f');
ss.replace(cLocale.groupSeparator(), yourGroupChar);
ss.replace(cLocale.decimalPoint(), yourDecimalPointChar);
BTW, spbots' question is not irrelevant. More detail about the goal always helps and it could lead to different approach that may serve you better.