[applets/calculator] Use Qt's in-built number formatting
ClosedPublic

Authored by davidedmundson on Jan 14 2020, 11:03 PM.

Details

Summary

Gets rid of a load of code.
Correctly handles floating point issues.
Results are correct.

Potentially this inadvertedly introduces a behaviour change
of including group separators depending on locale.
Is this a a good feature?

BUG: 410988

Test Plan

62 * 1.3 = 80.6

100000000 * 5000000 = 5e+17
(with whatever the right number of zeroes is)

42 * 1.33333 = 6.6666665

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Plasma. · View Herald TranscriptJan 14 2020, 11:03 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Jan 14 2020, 11:03 PM
ngraham added a subscriber: ngraham.

Potentially this inadvertedly introduces a behaviour change
of including group separators depending on locale.
Is this a a good feature?

I can't speak for everyone, but personally I like seeing the localized separators as I feel like they make it easier to read long numbers.

ngraham accepted this revision.Jan 14 2020, 11:39 PM

Can confirm that it fixes the bug, and the code change looks sane to me.

This revision is now accepted and ready to land.Jan 14 2020, 11:39 PM
This revision was automatically updated to reflect the committed changes.