D13172: Add AFNumber_Format and l10n AFSimple_Calculate
Andre Heinecke
noreply at phabricator.kde.org
Mon Jun 18 13:36:34 UTC 2018
aheinecke added a comment.
There is a side effect here that AF_SimpleCalculate now returns a localized number which will have group Seperators according to the system locale. See my inline comment about this.
INLINE COMMENTS
> calculatetexttest.cpp:89
> QCOMPARE (fields[QStringLiteral ("AVG")]->text(), QStringLiteral( "20" ));
> - QCOMPARE (fields[QStringLiteral ("Prod")]->text(), QStringLiteral( "6000" ));
> + QCOMPARE (fields[QStringLiteral ("Prod")]->text(), QStringLiteral( "6,000" ));
> QCOMPARE (fields[QStringLiteral ("Min")]->text(), QStringLiteral( "10" ));
Should just the calculate localize the number?
Acrobat does not do this. In Acrobat the result here is "6000".
But I think that for a KDE / Qt Application it is the correct behavior. As the number format can be set by the user through System Settings and we should respect that here when we convert a number to a string.
It is likely IMO that this is not a real world problem anyway as most forms with calculated values will have explicit number format functions.
REPOSITORY
R223 Okular
REVISION DETAIL
https://phabricator.kde.org/D13172
To: aheinecke, aacid
Cc: okular-devel, ngraham, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180618/9a454bf9/attachment.html>
More information about the Okular-devel
mailing list