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

Fatal error while loading Bar Chart #1511

Closed
codyfazio opened this issue Sep 21, 2016 · 2 comments
Closed

Fatal error while loading Bar Chart #1511

codyfazio opened this issue Sep 21, 2016 · 2 comments

Comments

@codyfazio
Copy link

My app keeps crashing with the error " fatal error: Double value cannot be converted to Int because it is either infinite or NaN." The crash happens in the return line of the function below, found in ChartUtils. It's for a bar chart if it makes any difference! Any thoughts?

internal class func decimals(_ number: Double) -> Int
{
if number == 0.0
{
return 0
}

    let i = roundToNextSignificant(number: Double(number))
    return Int(ceil(-log10(i))) + 2
}
@danielgindi
Copy link
Collaborator

Did you add a NaN value?

@codyfazio
Copy link
Author

No, but actually the number returned from roundToNextSignificant() is.

pmairoldi pushed a commit that referenced this issue Sep 22, 2016
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