[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #12909 [Stem]: stem.util.str_tools.get_size_label() insufficiently precise



#12909: stem.util.str_tools.get_size_label() insufficiently precise
----------------------------+--------------------
     Reporter:  mmcc        |      Owner:  atagar
         Type:  defect      |     Status:  closed
     Priority:  normal      |  Milestone:
    Component:  Stem        |    Version:
   Resolution:  worksforme  |   Keywords:
Actual Points:              |  Parent ID:
       Points:              |
----------------------------+--------------------
Changes (by atagar):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 Hi mmcc. Thanks for pointing this out though this isn't a Stem bug. Stem
 allows you to provide the precision for its results...

 {{{
 >>> from stem.util.str_tools import get_size_label
 >>> get_size_label(1850000000000, decimal = 2)
 '1.68 TB'
 >>> get_size_label(1850000000000, decimal = 40)
 '1.6825651982799172401428222656250000000000 TB'
 }}}

 The arm ticket is mostly about deciding a balance between space concerns
 and precision. Showing '1.682565198279917240142822265625 TB' in the above
 example would be unacceptable since it would be too wide, but you're right
 that '1 TB' isn't great either. This will probably be a compromise of a
 couple decimal places or so.

 Arm is undergoing a major, multi-month overhaul and I plan to take care of
 issues of that sort at the end.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12909#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs