-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Fix decimals crash in ChartsUtil #1558
Conversation
f4aee89
to
7bc798b
Compare
It's supposed to calculate a default number of decimals to show after the decimal point |
It's not really important what the value is on edge cases. It is used as a default for formatters that were not configured by the user, it just shouldn't crash :-) |
The main reason I was asking what it does is that I believe it does not do what it's supposed to. See the |
This issue is still there in AxisRendererBase.swift on line 125 |
@petester42 @danielgindi this isn't resolved yet..
also crash with something as simple as:
|
Guys, the reason that this is not fixed, is that we do not see this error.
|
Closes #1550, #1540, #1491
I added some tests based on the crash mentioned in #1550 and there was a crash when using DBL_MAX as the input of the
decimals
function.There are still some abnormalities in the
decimals
function I believe. In MPAndroidCharts I ran the same tests and it returns 2 not zero for all these cases except for the ones that crash and return negative Int max.This pull request fixes the crash but I don't think the
decimals
function does what we want it to do.@danielgindi, @PhilJay what is this function actually supposed to do?