Floating Points in Panel Graduated

I know I mentionned this before here but I would like to ask if you’re planning to fix this issue in one of the next releases ?

Maybe issue is not the best word to describe it since it’s not a Gojs related bug but it’s how binary fractions - floating numbers works.

However, I think it’s always better to display nice rounded numbers in this example for instance.

Better than creating a format method to just hide the issue.

If you want to display numbers in text form in some manner, then you need to use a conversion function that converts a number to a string with the characteristics that you prefer.

You mean graduatedFunction ?

Yes, that’s it.

That’s what I am using. It’s commented in the example I provided to demonstrate the issue.

In my Graduated Widget, the user can modify the max and min values. The number of displayed ticks is set according to the desiredSize of Knob. Therefore, I am using graduatedSkip to display N ticks.

That means, if graduatedSkip returns a floating number I need to match that value to the pre-defined list of ticks to decide whether to display it or not. Then as you said, I need to adjust the displayed tick value using graduatedFunction. Finally, the formatting the returned result of the Indicator as well.

By doing that there is sometimes an inaccuracy between the Formated Tick and it’s real value but that’s a minor issue since it’s impossible to detect in the UI, I guess ? Not sure if the min and max are close values like (0.00000001, 0.000000011 with 100 ticks to display)

For me, almost, everything working fine - except I have tons of logic to adjust the returned tick values and predict which base 10 value is the closest to the tick.