Bug 409077 - Unit Converter should localize display of large numbers
Summary: Unit Converter should localize display of large numbers
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kunitconversion
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: John Layt
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2019-06-23 14:03 UTC by Philip Murray
Modified: 2019-09-03 18:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.62
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Murray 2019-06-23 14:03:27 UTC
SUMMARY

After seeing the KDE Usability & Productivity: Week 76 
https://pointieststick.com/2019/06/23/kde-usability-productivity-week-76/comment-page-1/#comment-5679
regarding this change: https://phabricator.kde.org/D21983

My suggestion: the large values >1k would read more easily if the thousands were comma-separated. e.g. 12,000,000.00, as it would then be easier to recognise it as 12million, rather than having to count all the zeroes.

STEPS TO REPRODUCE: search/use unit converter for 12 kilometers

OBSERVED RESULT: various results as per here: https://phabricator.kde.org/file/data/w5hyljh7b4tvmdijy5ty/PHID-FILE-fqj2qiuy4bt3e6q5okf4/unit_converter.png

EXPECTED RESULT: make the large figures look nicer by comma-separating the thousands. e.g. 12,000,000 rather than 12000000.

SOFTWARE/OS VERSIONS
KDE Plasma Version: KDE Plasma 5.16.2
Comment 1 Eridani Rodríguez 2019-06-23 15:05:23 UTC
That may work on the USA, but the rest of the world mostly use comma on the line [,] to separate from decimal units so the notation may become messy if not handled with care; below a copy pasta from ISO 8601 E norm:

"If a decimal fraction is included, lower order components (if any) shall be omitted and the decimal fraction shall be divided from the integer part by the decimal sign specified in ISO 31-0: i.e. the comma [,] or full stop [.]. Of these, the comma is the preferred sign."

But there are also some weird notations on certain countries (e.g. México), where while using the SI they use full stop [.] to separate decimal units (like USA). Therefore, it is recommended to just use space [ ] to separate groups of 3 numbers for better readability on a numeric notation and never use comma [,] or full stop [.] as these are reserved for decimal units.

For example, one million (1000000) may be written as 1 000 000 for better readability.
Comment 2 Vladimir Yerilov 2019-06-23 15:14:50 UTC
Just don't forget about differences due to regional formats, some may find comma separation to be misleading. It's better to make this input field honor regional settings. I now have 5.16.1 and as far as I understand this enhancement has come from KRunner, so I want to note that Krunner has no such separation as well.
Comment 3 Philip Murray 2019-06-23 17:51:29 UTC
Making it display as per the regional norm sounds sensible. Using spaces sound decent too. UK uses commas for thousands and full stops for decimals, hence my wish for it.
Comment 4 Nate Graham 2019-06-24 09:45:25 UTC
Right, this needs to respect regional settings for sure.
Comment 5 Kai Uwe Broulik 2019-06-24 09:51:27 UTC
You might want to revisit a patch I tried to do a while back: https://git.reviewboard.kde.org/r/127800/
Comment 6 Nate Graham 2019-06-24 10:42:24 UTC
Thanks Kai. Your patch works perfectly. I've re-submitted it as https://phabricator.kde.org/D22069. Let's see if we can get it in.
Comment 7 Nate Graham 2019-09-03 18:08:11 UTC
Git commit b0dbb285bd2119fe980a714f7d01ec140f2b8138 by Nate Graham.
Committed on 03/09/2019 at 18:08.
Pushed by ngraham into branch 'master'.

Localize long number strings

Summary:
Localize long number strings so that they get the proper locale-specific separator.

This is based on @broulik's old patch from https://git.reviewboard.kde.org/r/127800
FIXED-IN: 5.62

Test Plan:
Unit tests pass.

With US English locale, before: {F6930198}

With US English locale, after: {F6930199}

Reviewers: #localization, #frameworks, broulik, aacid

Reviewed By: #localization, aacid

Subscribers: aacid, huftis, safaalfulaij, mikeroyal, aspotashev, ilic, kde-frameworks-devel, broulik

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D22069

M  +4    -1    autotests/klocalizedstringtest.cpp
M  +7    -7    src/klocalizedstring.cpp

https://commits.kde.org/ki18n/b0dbb285bd2119fe980a714f7d01ec140f2b8138