Skip Menu |

This queue is for tickets about the Number-Bytes-Human CPAN distribution.

Report information
The Basics
Id: 114296
Status: resolved
Priority: 0/
Queue: Number-Bytes-Human

People
Owner: Nobody in particular
Requestors: jes [...] netcraft.com
martin [...] hinterlands.org
Cc: PLICEASE [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.01
  • 0.02
  • 0.03
  • 0.04
  • 0.05
  • 0.06
  • 0.07
  • 0.09
Fixed in: 0.10



Subject: N::B::H 0.09 handles fractional units incorrectly.
Date: Thu, 17 Jul 2014 23:13:56 +0100
To: bug-Number-Bytes-Human [...] rt.cpan.org
From: "Martin A. Brooks" <martin [...] hinterlands.org>
Hello With N::B::H 0.09 as installed from Ubuntu's package repo: $ perl -e 'use Number::Bytes::Human qw(parse_bytes); print parse_bytes("5 TB")."\n";' 5000000000000 $ perl -e 'use Number::Bytes::Human qw(parse_bytes); print parse_bytes("5.5 TB")."\n";' 5005000000000 $ perl -e 'use Number::Bytes::Human qw(parse_bytes); print parse_bytes("5.500 TB")."\n";' 5500000000000 This is perl 5.18.2, Ubuntu stock. Mart.
CC: ferreira [...] cpan.org, dagobert [...] cpan.org
Subject: Patch for bug #97324
Date: Tue, 10 May 2016 10:40:22 +0100
To: bug-Number-Bytes-Human [...] rt.cpan.org
From: James Stanley <jes [...] netcraft.com>
Hello, Number::Bytes::Human bug #97324 ( https://rt.cpan.org/Public/Bug/Display.html?id=97324 ) makes parse_bytes behave incorrectly. For example: $ perl -MNumber::Bytes::Human=parse_bytes -e 'print parse_bytes("1G"), "\n"' 1073741824 $ perl -MNumber::Bytes::Human=parse_bytes -e 'print parse_bytes("1.5G"), "\n"' 1078984704 It thinks 1.5G means 1.005G. I've attached a patch to fix this. It also includes a fix for an existing test case and an additional test case. Let me know if you want anything changed. Regards, James Stanley Netcraft Ltd

Message body is not shown because sender requested not to inline it.

Hi James, Am Di 10. Mai 2016, 05:40:39, jes@netcraft.com schrieb: Show quoted text
> Number::Bytes::Human bug #97324 ( > https://rt.cpan.org/Public/Bug/Display.html?id=97324 ) makes parse_bytes > behave incorrectly. > > I've attached a patch to fix this.
I applied the patch and made a new 0.10 release. Additionally, I synced my GitHub repo so a convenient pull request is possible next time: https://github.com/dago/Number-Bytes-Human Thanks for the patch! -- Dago
I applied the patch and made a new release 0.10