Skip to content

Trim ToString() for units without abbreviation #912

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

Merged
merged 3 commits into from
Apr 5, 2021

Conversation

angularsen
Copy link
Owner

@angularsen angularsen commented Mar 19, 2021

Scalar, Ratio and other quantities with units that don't have an abbreviation,
would result in a trailing whitespace.

Example: Scalar.FromAmount(1).ToString() == "1 "

Scalar, Ratio and other quantities with units that don't have an abbreviation,
would result in a trailing whitespace.

Example: Scalar.FromAmount(1).ToString() == "1 "
@angularsen angularsen force-pushed the angularsen/trim-tostring-noabbrev branch from 94bd729 to e7259da Compare March 19, 2021 23:44
@codecov
Copy link

codecov bot commented Mar 20, 2021

Codecov Report

Merging #912 (e7259da) into master (2d23eac) will increase coverage by 0.1%.
The diff coverage is 100.0%.

❗ Current head e7259da differs from pull request most recent head 520613c. Consider uploading reports for the commit 520613c to get more accurate results
Impacted file tree graph

@@           Coverage Diff            @@
##           master    #912     +/-   ##
========================================
+ Coverage    82.8%   82.8%   +0.1%     
========================================
  Files         291     291             
  Lines       44040   44043      +3     
========================================
+ Hits        36423   36426      +3     
  Misses       7617    7617             
Impacted Files Coverage Δ
UnitsNet/QuantityFormatter.cs 94.9% <100.0%> (+0.5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d23eac...520613c. Read the comment docs.

Copy link
Collaborator

@lipchev lipchev left a comment

Choose a reason for hiding this comment

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

It is quite unlikely but not impossible that someone out there is doing something like string.split(x)[1]

@angularsen angularsen merged commit a6615fd into master Apr 5, 2021
@angularsen angularsen deleted the angularsen/trim-tostring-noabbrev branch April 5, 2021 12:12
@angularsen
Copy link
Owner Author

It is quite unlikely but not impossible that someone out there is doing something like string.split(x)[1]

Right, but I still think the improvement outweighs the downside in that scenario.

@angularsen
Copy link
Owner Author

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.

2 participants