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

Issue335-Unit-format-if-numerator-is-1-in-unit-faction #348

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

olbrich
Copy link
Owner

@olbrich olbrich commented Mar 16, 2024

Fixes #335

Allows Formatting of units in exponential form (e.g., '1 m*s^-2' instead of '1 m/s^2').

Also introduces a configuration that allows this to be globally enabled.

RubyUnits.configure do |config|
  config.format = :exponential
end

Fixes #335

Add `format: :exponential` as an option on `#to_s` and `units`.

This will formate the unit with all units treated like exponentials, ones in the denominator will have negative powers.
@olbrich olbrich self-assigned this Mar 16, 2024
@olbrich olbrich added the Minor add functionality in a backwards-compatible manner label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor add functionality in a backwards-compatible manner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit format if numerator is 1 in unit faction
1 participant