Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversion error from Micrometer to Nanometer in Length class #653

Closed
tongyi87 opened this issue Apr 16, 2019 · 2 comments
Closed

Conversion error from Micrometer to Nanometer in Length class #653

tongyi87 opened this issue Apr 16, 2019 · 2 comments
Labels

Comments

@tongyi87
Copy link

Describe the bug
Loss of precision when converting from Micrometer to Nanometer.

To Reproduce
Steps to reproduce the behavior:
Build:

  1. Add nuget UnitsNet 4.18.0 to a .NET Core 2.1 project
  2. Build using Visual Studio 2017 Enterprise
  3. See screenshot.

Expected behavior
Converting 5100 micrometer to nanometer should yield 51000000

Screenshots
image

@tongyi87 tongyi87 added the bug label Apr 16, 2019
@angularsen
Copy link
Owner

angularsen commented Apr 19, 2019

Hi and thanks for reporting. This is unfortunately by design, due to using double value type internally and how we first convert from one unit to a base unit (Meter in this case) and then to the target unit.

We do have some ideas to improve this in #478 and in #588.

Did that answer your question?

Best,
Andreas

@angularsen
Copy link
Owner

Closing due to inactivity. Reopen to continue the discussion.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants