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

Better handling of Rational values in #to_s #26

Merged
merged 2 commits into from Jan 8, 2015

Conversation

Projects
None yet
2 participants
@fordhurley
Copy link
Collaborator

fordhurley commented Jan 4, 2015

Added #value_string to parallel #unit_string, which does two things when the value is Rational:

  • If the denominator is 1, don't show it.
  • Otherwise, wrap the value in parentheses so that it can be parsed properly.

Also added specs for two cases that would fail previously.

Should fix #22.

Better handling of Rational values in #to_s
Added #value_string to parallel #unit_string, which does two things when
the value is Rational:

- If the denominator is 1, don't show it.
- Otherwise, wrap the value in parentheses so that it can be parsed
  properly.

Also added specs for two cases that would fail previously.

Should fix #22.
@minad

This comment has been minimized.

Copy link
Owner

minad commented Jan 7, 2015

Hi, I added you as a collaborator. You can push yourself and just tell we when you think it is ready for a release. Could you also add tests for value_string etc?

@fordhurley

This comment has been minimized.

Copy link
Collaborator

fordhurley commented Jan 8, 2015

Great! Specs on value_string was a great idea.

fordhurley added a commit that referenced this pull request Jan 8, 2015

Merge pull request #26 from fordhurley/fix-rational-to_s
Better handling of Rational values in #to_s

@fordhurley fordhurley merged commit df0fca8 into minad:master Jan 8, 2015

1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment