<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><br>
Shouldnt you be using the locale functions?<br>
<a class="moz-txt-link-freetext" href="http://www.cplusplus.com/reference/locale/">http://www.cplusplus.com/reference/locale/</a><br>
<br>
I haven't personally used them, so sorry no experience I can
share.<br>
<br>
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. <br>
<div class="moz-signature">
<p>Chris<br>
<a href="http://www.rebel.com.au">Rebel Software</a>
</p>
</div>
On 30/05/2014 9:11 AM, Allan wrote:<br>
</div>
<blockquote cite="mid:5387C5B5.8090101@gmail.com" type="cite">On
29/05/14 12:36, Allan wrote:
<br>
<blockquote type="cite">Previously, I dealt successfully with
importing with a user's locale,
<br>
but now I'm hitting a problem.
<br>
<br>
I'm working on a patch to fix "[Bug 334995] CSV import
Debit/Credit mode
<br>
only looks at one column, credits become 0.00". I have the
patch
<br>
working for my own locale - UK. However, for other locales, I
converted
<br>
my test file to use comma decimal and semi-colon separator.
This is
<br>
giving me grief. What I'm trying to do is to convert a QString
currency
<br>
amount to double, to be able to test if the amount is non-zero,
as
<br>
against empty.
<br>
<br>
The basic problem came as a surprise, when I found that QString
was not
<br>
locale-aware. I'm getting caught between QLocale and KLocale.
I am
<br>
setting the country to, say, France. However, QLocale still
seems to be
<br>
set to UK. Things seem to work if I set QLocale::default() to
France,
<br>
but how do I know which country the user is in?
<br>
<br>
It looks like QLocale doesn't take account of KDE country
change, but
<br>
retains the original system locale. How can I get the KDE
locale to
<br>
give a country that QLocale will accept?
<br>
<br>
Or, am I missing the simple answer?
<br>
<br>
Allan
<br>
</blockquote>
<br>
Replying to myself here.
<br>
<br>
It sounds like all will be sweetness and light in Qt5/Framework 5,
at least on the locale front.
<br>
<br>
Meanwhile, Plan B
<br>
<br>
Allan
<br>
_______________________________________________
<br>
KMyMoney-devel mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:KMyMoney-devel@kde.org">KMyMoney-devel@kde.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/kmymoney-devel">https://mail.kde.org/mailman/listinfo/kmymoney-devel</a>
<br>
<br>
<br>
</blockquote>
<br>
</body>
</html>