Skip to content
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

added option to get decimal point in uncertainty formatted with "parenthesis" notation #60

Closed

Conversation

alusiani
Copy link
Contributor

@alusiani alusiani commented Aug 1, 2024

Hi,

I propose a small unobstructive addition to the code in order to optionally get the decimal point formatted when using the "parenthesis" notation. Example of usage:

format(set_errors(123.456, 12.345), notation = "parenthesis", digits=4)
## -> '123.46(1234)'
## default formatting
saved_options = options(errors.parenthesis.unc.dec.point = TRUE)
format(set_errors(123.456, 12.345), notation = "parenthesis", digits=4)
options(saved_options)
## -> '123.46(12.34)'
## optional formatting

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (cc2f192) to head (5b7c42e).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
- Coverage   97.28%   96.60%   -0.69%     
==========================================
  Files          12       12              
  Lines         516      530      +14     
==========================================
+ Hits          502      512      +10     
- Misses         14       18       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Enchufa2 Enchufa2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for this. I see that some of the changes that I did in the last commits have been undone for some reason. Please restore them. Comments below.

R/print.R Outdated Show resolved Hide resolved
R/print.R Outdated Show resolved Hide resolved
R/print.R Outdated Show resolved Hide resolved
R/print.R Outdated Show resolved Hide resolved
R/print.R Outdated Show resolved Hide resolved
tests/testthat/test-print.R Outdated Show resolved Hide resolved
tests/testthat/test-print.R Outdated Show resolved Hide resolved
tests/testthat/test-print.R Outdated Show resolved Hide resolved
tests/testthat/test-print.R Outdated Show resolved Hide resolved
tests/testthat/test-print.R Outdated Show resolved Hide resolved
@alusiani
Copy link
Contributor Author

alusiani commented Aug 1, 2024

Sorry for the changes, I should have checked more carefully. I was merging from an older revision I did. Part of the changes were related to using meld with omission of whitespace diffs.

I have now applied all requested changes, committed and pushed to github. As far as I understand, that should be enough, please let me know if I also need to resubmit the pull request.

@Enchufa2
Copy link
Member

Enchufa2 commented Aug 1, 2024

Thanks! I renamed (and shortened) the new option, and added a new argument decimals to give it more visibility. I also refactored the code a little bit. Since you didn't give me push permission, I'm closing this one in favour of #61, I hope you don't mind.

@Enchufa2 Enchufa2 closed this Aug 1, 2024
@alusiani
Copy link
Contributor Author

alusiani commented Aug 1, 2024

Thanks! I renamed (and shortened) the new option, and added a new argument decimals to give it more visibility. I also refactored the code a little bit. Since you didn't give me push permission, I'm closing this one in favour of #61, I hope you don't mind.

No problem! I am not an expert of pull requests and have not realized that a push permission was asked or required.

@Enchufa2
Copy link
Member

Enchufa2 commented Aug 2, 2024

It is not required, but it is convenient when, like in this case, the owner of the repo wants to add some adjustments to the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decimal point in uncertainty in "parenthesis" format
2 participants