On Fri, May 30, 2014 at 12:44 PM, Thomas Baumgart <t...@net-bembel.de> wrote:
> > Hmm, that still leaves a problem: you never know if the file the user has > matches his locale. I've seen banks in Germany delivering CSV files with a dot > as decimal symbol while we usually use a comma for that purpose. Since the > same applies to QIF, I once wrote > > void MyMoneyQifProfile::scanNumeric(const QString& txt, QChar& decimal, QChar& > thousands) const > > which scans the string to determine decimal and thousand separator characters. > Once you have that, you could use regular Alkimia for what you want to do. > Here's how: > > QString inputVal; // your unknown input data > QChar decimal('.'), thousands; // make the dot the default > scanNumeric(inputVal, decimal, thousands); > if(AlkValue(inputVal, decimal) == AlkValue(0)) { > } > > Since scanNumeric is not static either, simply make a copy of it in your > class. > > Does that make sense? > > Hi, You could also move that method to KMyMoneyTools, so it's available for general use. Regards, Alvaro _______________________________________________ KMyMoney-devel mailing list KMyMoney-devel@kde.org https://mail.kde.org/mailman/listinfo/kmymoney-devel