Thanks for the feedback; you're right, and in fact someone already
submitted a patch for fixing this. I've been planning a major
overhaul since Number::Format conflicts with modern perls' locale
support, but haven't gotten around to it. I'll try to get a new
version out soon.
Guest via RT writes:
Show quoted text>
>This message about Number-Format was sent to you by guest <> via rt.cpan.org
>
>Full context and any attached attachments can be found at:
><URL:
https://rt.cpan.org/Ticket/Display.html?id=6147 >
>
>format_bytes(1024) returns '1,024' not '1K'.
>Similar results occur for 1024*1024 ('1,024K', not '1M'), etc.
>
>This is because format_bytes uses ">" and not ">=" in its if conditions: i.e., because 1024 is not > 1024, it does not get formatted to units of K.
>
>The documentation is congruent with this behavior ("except that if the number is *over* 1024 [my emphasis], it will be divided by 1024 and "K" appended to the end") but that seems fairly counter-intuitive.
--
William R. Ward william.ward@bayview.com
President (650) 279-9904
Bay View Consulting Services, Inc.
http://www.bayview.com/
------------------------------------------------------------------------
Learn Perl in 8 hours!
http://www.bayview.com/training/