Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-31 Thread Allan
On 30/05/14 18:26, Allan wrote: loc->readMoney() is supposed to return a double. Using that one in a debug stream as you do, uses the standard Qt functions to convert it into a string (I doubt they are locale aware). So I expect the problem to be right there. What happens, if you use qDe

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-30 Thread Allan
loc->readMoney() is supposed to return a double. Using that one in a debug stream as you do, uses the standard Qt functions to convert it into a string (I doubt they are locale aware). So I expect the problem to be right there. What happens, if you use qDebug() << QLocale::toCurrencyStrin

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-30 Thread Allan
On 30/05/14 16:44, Thomas Baumgart wrote: Allen, On Friday 30 May 2014 14:00:02 Allan wrote: [...] On 30/05/14 13:10, Thomas Baumgart wrote: I need to convert a monetary string to double in order to test if it is zero, or empty. Previously, when there was either a valid debit or credit valu

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-30 Thread Alvaro Soliverez
On Fri, May 30, 2014 at 12:44 PM, Thomas Baumgart 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 > sa

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-30 Thread Thomas Baumgart
Allen, On Friday 30 May 2014 14:00:02 Allan wrote: [...] > On 30/05/14 13:10, Thomas Baumgart wrote: > > I need to convert a monetary string to double in order to test if it is > zero, or empty. Previously, when there was either a valid debit or > credit value, I didn't take the other field in

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-30 Thread Allan
On 30/05/14 13:10, Thomas Baumgart wrote: Allen, On Friday 30 May 2014 12:25:10 Allan wrote: Hi Thomas On 30/05/14 07:00, Thomas Baumgart wrote: Hi Allen, On Thursday 29 May 2014 12:36:42 Allan wrote: Previously, I dealt successfully with importing with a user's locale, but now I'm hitting

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-30 Thread Thomas Baumgart
Allen, On Friday 30 May 2014 12:25:10 Allan wrote: > Hi Thomas > > On 30/05/14 07:00, Thomas Baumgart wrote: > > Hi Allen, > > > > On Thursday 29 May 2014 12:36:42 Allan wrote: > >> Previously, I dealt successfully with importing with a user's locale, > >> but now I'm hitting a problem. > >> >

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-30 Thread Allan
Hi Thomas On 30/05/14 07:00, Thomas Baumgart wrote: Hi Allen, On Thursday 29 May 2014 12:36:42 Allan wrote: Previously, I dealt successfully with importing with a user's locale, but now I'm hitting a problem. I'm working on a patch to fix "[Bug 334995] CSV import Debit/Credit mode only looks

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-29 Thread Thomas Baumgart
Hi Allen, On Thursday 29 May 2014 12:36:42 Allan wrote: > Previously, I dealt successfully with importing with a user's locale, > but now I'm hitting a problem. > > I'm working on a patch to fix "[Bug 334995] CSV import Debit/Credit mode > only looks at one column, credits become 0.00". I have

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-29 Thread Chris
Shouldnt you be using the locale functions? http://www.cplusplus.com/reference/locale/ I haven't personally used them, so sorry no experience I can share. if you write your own function to do the conversion don't assume the number has a decimal portion it may be rounded to whole numbers only.

Re: [Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-29 Thread Allan
On 29/05/14 12:36, Allan wrote: Previously, I dealt successfully with importing with a user's locale, but now I'm hitting a problem. I'm working on a patch to fix "[Bug 334995] CSV import Debit/Credit mode only looks at one column, credits become 0.00". I have the patch working for my own local

[Kmymoney-devel] Another locale puzzle - CSV Importer

2014-05-29 Thread Allan
Previously, I dealt successfully with importing with a user's locale, but now I'm hitting a problem. I'm working on a patch to fix "[Bug 334995] CSV import Debit/Credit mode only looks at one column, credits become 0.00". I have the patch working for my own locale - UK. However, for other lo