SUMMARY KUnitConversion does not feature data storage units in the current source tree[1] (f46927e). I think this is a useful feature to add. STEPS TO REPRODUCE 1. Install the Unit Conversion addon for KRunner 2. Launch KRunner 3. Type "12 gigabytes in mebibytes" into the search bar OBSERVED RESULT No result EXPECTED RESULT A result of 11444.09 mebibytes SOFTWARE/OS VERSIONS Operating System: Debian GNU/Linux KDE Plasma Version: 5.14.3 Qt Version: 5.11.2 KDE Frameworks Version: 5.51.0 Kernel Version: 4.19.0-1-amd64 OS Type: 64-bit Processors: 4 × Intel Core Processor (Skylake, IBRS) Memory: 5.4 GiB of RAM ADDITIONAL INFORMATION It's easy to substitute bits as grams for conversion, like kilobit to kilogram, megabit to megagram, terabit to teragram, since both a bit and a gram equal 1. Additionally, the prefixes kilo, mega, terra, ... yotta are used by both, and mean the same thing. However, this does not help when trying to convert a bit to a byte (which is 8 bits), or SI prefixes (exponents of 1000) to binary prefixes like kibi, mebi, yobi (exponents of 1024). The units I would expect to be added are bits (1), and bytes (8), with SI (1K = 1000) and binary (1Ki = 1024) permutations for each from kilo/kibi to yotta/yobi. Adding these units would be very useful, since while using a computer, users deal with these types of units all the time. NIST has some information about binary prefixes[2][3]. [1] https://phabricator.kde.org/source/kunitconversion/browse/master/;f46927e9b196d78d117ce06516624094d33dd789 [2] https://physics.nist.gov/cuu/Units/binary.html [3] (wayback machine since [2] is down temporarily due to the 2019 US government shutdown) https://web.archive.org/web/20181126092457/https://physics.nist.gov/cuu/Units/binary.html
Good idea. This kind of thing is really easy to add; would you like to try your hand at it? Here's an example of how it's done: https://cgit.kde.org/kunitconversion.git/commit/?id=b2419e57eeea5cd98b3bfb42c3032b421633bf39 I'd be happy to help you if you'd like!
I would be fine with doing it. I'll give it my best shot. Do I submit a patch here, or to Phabricator? Also, how do I temporarily replace my system's kunitconversion for testing?
(In reply to Jonathan Rubenstein from comment #2) > I would be fine with doing it. I'll give it my best shot. Do I submit a > patch here, or to Phabricator? On Phabricator. Here are the instructions: https://community.kde.org/Infrastructure/Phabricator > Also, how do I temporarily replace my system's kunitconversion for testing? There are three ways: 1. Source the prefix.sh file created by CMake (which is located at ~/kde/build/frameworks-kunitconversion/prefix.sh if you're using kdesrc-build) and then restart krunner. 2. Do your development in a KDE Neon dev unstable VM and configure kdesrc-build to copy all built binaries to /usr automatically, then reboot. 3. Copy the build binaries to the appropriate locations in /usr and restart krunner. Once you're done testing, reinstall your distro-provided package. Needless to say, this is a bit more risky. :)
I have no excuse for taking this long, sorry. Here's a Phabricator Differential https://phabricator.kde.org/D20181
D20181 is taking a while but is still open. https://phabricator.kde.org/D20181
Git commit 6c193856f9f472f350ba7634eb2c1bdcd89bb2ea by Nate Graham, on behalf of Jonathan Rubenstein. Committed on 17/07/2019 at 02:03. Pushed by ngraham into branch 'master'. Add Binary Data units (bits, kilobytes, kibibytes ... yottabytes) Summary: New data category BinaryDataCategory featuring bits and bytes, both SI units and powers of two, from normal bits all the way up to Yibibytes. This only features ( positive SI prefix | IEC power of two prefix ) + ( bits | bytes ), and does not include units like nibbles (half a byte), octets (alternative form of byte), or prefixes that are less than 1. My reasoning behind this is to keep it clean and uncluttered. FIXED-IN: 5.61 {F6743030} {F6743029} Test Plan: Open KRunner and attempt to use new units. New units show up successfully. Reviewers: broulik, #plasma, ngraham Reviewed By: ngraham Subscribers: abetts, cfeck, apol, aacid, ngraham, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D20181 M +1 -0 README.md M +1 -0 src/CMakeLists.txt A +365 -0 src/binary_data.cpp [License: LGPL (v2+)] A +36 -0 src/binary_data_p.h [License: LGPL (v2+)] M +2 -0 src/converter.cpp M +73 -2 src/unit.h https://commits.kde.org/kunitconversion/6c193856f9f472f350ba7634eb2c1bdcd89bb2ea