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

Include the non-prefixed BaseUnits in the BaseUnitPrefixes #1492

Merged
merged 2 commits into from
Jan 19, 2025

Conversation

lipchev
Copy link
Collaborator

@lipchev lipchev commented Jan 4, 2025

Include the non-prefixed BaseUnits in the BaseUnitPrefixes:

  • the BaseUnitPrefixes now also handles the case where prefixing an already prefixed base unit results in a non-prefixed base unit
  • regenerating the quantities resulted in a number of new BaseUnits to become available (as well as some which got their scales reduced)

@lipchev lipchev requested a review from angularsen January 7, 2025 21:38
@@ -109,7 +109,7 @@ static Power()
new UnitInfo<PowerUnit>(PowerUnit.MetricHorsepower, "MetricHorsepower", BaseUnits.Undefined, "Power"),
new UnitInfo<PowerUnit>(PowerUnit.Microwatt, "Microwatts", new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Milligram, time: DurationUnit.Second), "Power"),
new UnitInfo<PowerUnit>(PowerUnit.MillijoulePerHour, "MillijoulesPerHour", BaseUnits.Undefined, "Power"),
new UnitInfo<PowerUnit>(PowerUnit.Milliwatt, "Milliwatts", BaseUnits.Undefined, "Power"),
new UnitInfo<PowerUnit>(PowerUnit.Milliwatt, "Milliwatts", new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Gram, time: DurationUnit.Second), "Power"),
Copy link
Owner

Choose a reason for hiding this comment

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

Ok, this example I can relate to. Watt is m*kg*s, so Milliwatt can be m*g*s.

Copy link
Owner

Choose a reason for hiding this comment

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

Seems like you keep getting more and more base units defined, nice 👏

@angularsen angularsen merged commit 428b58b into angularsen:release/v6 Jan 19, 2025
1 check passed
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