c++ - Qt - custom decimal point and thousand separator -
how can convert number (double) string, custom decimal point , thousand separator chars?
i've seen qlocale, don't want choose localization country, rather specify own decimal point , thousand separator chars.
thanks
qt doesn't support custom locale. deal group , decimal point characters 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 not irrelevant. more detail goal helps , lead different approach may serve better.
Comments
Post a Comment