Skip Menu |

This queue is for tickets about the Time-Duration CPAN distribution.

Report information
The Basics
Id: 90822
Status: rejected
Priority: 0/
Queue: Time-Duration

People
Owner: Nobody in particular
Requestors: CRAIHA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.1
Fixed in: (no value)



Subject: _render adds a comma before and
I noticed when I was using duriation_exact that it doesn't return exactly what I was expecting. As an example when running duration_exact(65.123) # got: '1 minute, 5 seconds, and 123 milliseconds' # expected: '1 minute, 5 seconds and 123 milliseconds' The bug is the comma before the and. I checked the code and found the problem in the _render sub. I'm proposing you could change the two last rows: $wheel[-1] = "and $wheel[-1]"; return join q{, }, @wheel; To something like this: my $last_wheel = ' and ' . pop @wheel; return join(q{, }, @wheel) . $last_wheel; It seems to fix the issue.
As designed.