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

Documentation Issue: Rounding #7460

Closed
MDOTEngSupport opened this issue Dec 6, 2024 · 2 comments
Closed

Documentation Issue: Rounding #7460

MDOTEngSupport opened this issue Dec 6, 2024 · 2 comments

Comments

@MDOTEngSupport
Copy link

{Describe the problem here}
"roundFactor value is rounded to a multiple of the round factor if it is a nonzero value and the applyRounding trait is set. e.g. if the roundFactor is set to 2, 42.2 would be rounded to 42 and 43.2 to 44."

Should 43.2 round to 43 instead of 44?

Found on page https://www.itwinjs.org/bis/ec/ec-format - "Format"

@ColinKerr
Copy link
Member

If no roundFactor value is set 43.2 will round to 43. If roundFactor is set to 2 then only multiples of 2 are valid values, so 40, 42, and 44 are valid values, 43.2 is closer to 44 than 42 so the value will be rounded to 44. If you set the round factor to 10 43.2 would round to 40.

The round factor defaults to 0 and is only set in special cases where the value needs to be rounded to something besides the nearest integer

@ColinKerr
Copy link
Member

I reviewed the tests we had for this attribute and I found that we were lacking formatting tests for this option. I have filed an issue to add tests: #7462

Thank you for raising this question!

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

No branches or pull requests

2 participants