-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed Duration format to correctly display negative values #746
Changed Duration format to correctly display negative values #746
Conversation
…gative values.
…h negative values Negative durations were not being printed properly; they looked positive. This one line addition prepends a negative sign to durations created from negative values. When the package is tested I get 4 failures, but I get these same 4 failures with no changes to the package code. So, I'm unsure how to resolve this.
…e_estimate as in original package code
If, you're interested in finishing this off, would you mind add a small unit test? No worries, if you're not, just let me know and I'll get it over the finish line for you. |
I can definitely put a unit test together for this! Thanks for taking a look. Would you mind if I don't get to it for a couple of days? If you do, then I'm perfectly happy for you to take it over the finish line...I don't want to hold anything up. |
No rush! |
@@ -101,6 +101,7 @@ format.Duration <- function(x, ...) { | |||
out <- vector("character", length(x@.Data)) | |||
nnas <- !is.na(x@.Data) | |||
out[nnas] <- compute_estimate(abs(x@.Data[nnas])) | |||
out[nnas] <- ifelse(x@.Data[nnas] < 0, paste0("-", out[nnas]), out[nnas]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this negative sign should be handled in compute_estimate
instead and that abs
removed.
I have fixed this at the root in |
Fixes #719