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

Update documentation on custom units #1132

Closed
Brunni opened this issue Sep 2, 2022 · 1 comment
Closed

Update documentation on custom units #1132

Brunni opened this issue Sep 2, 2022 · 1 comment
Labels

Comments

@Brunni
Copy link
Contributor

Brunni commented Sep 2, 2022

The documentation here is outdated. Some of the method parameters are deprecated:
https://github.com/angularsen/UnitsNet/wiki/Extending-with-Custom-Units

Also it is not really clear, if it makes more sense to implement IQuantity instead of IQuantity.

Would it be possible to use the generator also for custom units?

@Brunni Brunni added the bug label Sep 2, 2022
@angularsen
Copy link
Owner

angularsen commented Oct 31, 2022

Yes that part of the wiki needs some love. Extensibility is still a bit work in progress, and the least mature part of the library. Generally we are going away from enums and towards string based values in v5 (#982 ), which helps a bit.

I believe the wiki is editable by anyone, so please just add your suggested changes to it.

if it makes more sense to implement IQuantity instead of IQuantity.

Typo here maybe? IQuantity instead of..?

The generator is currently not easy to reuse for custom units. The current design allows adding units, conversions, abbreviations etc at runtime, but not at compile time. The new source generators might enable something in that direction, but I haven't digested the possibilities in that area yet: #902

@angularsen angularsen closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants