D20181: Add Binary Data units (bits, kilobytes, kibibytes ... yottabytes)

Jonathan Rubenstein noreply at phabricator.kde.org
Wed Jul 10 17:56:06 BST 2019


JJRcop added a comment.


  After some quick research I should have done a while ago, I have determined that KFormat is not nearly the same as what KUnitConversion does.
  
  KFormat can take an input number and output a string with the input formatted properly to the desired unit.
  
  KUnitConversion defines objects for various units with functions to convert between them. You can instantiate these objects using a number and unit type. There are a few objects, some defining the Unit itself, and some defining an instance of a Value in a certain Unit. Both of these objects have methods to convert an input into another Unit, which return either an output number or Value object in the new Unit.
  
  I am not able to use KFormat because KFormat takes an input number and only outputs a formatted string. This is exactly what it's designed for and doesn't need any changes, but is just not compatible with what KUnitConversion does as it handles numbers.
  
  https://api.kde.org/frameworks/kunitconversion/html/index.html
  https://api.kde.org/frameworks/kcoreaddons/html/classKFormat.html
  
  I believe no further changes are required for this patch.

REPOSITORY
  R292 KUnitConversion

REVISION DETAIL
  https://phabricator.kde.org/D20181

To: JJRcop, broulik, #plasma, ngraham
Cc: abetts, cfeck, apol, aacid, ngraham, kde-frameworks-devel, LeGast00n, michaelh, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190710/135c976c/attachment.html>


More information about the Kde-frameworks-devel mailing list