{"push_id":871446085,"size":1,"distinct_size":1,"ref":"refs/heads/RoundBeforeInt","head":"862de8907b9397a6732512e001d3e914e81043c1","before":"f80f7715c25b0dbdd8c3d0db21b3a4bfaf51c01f","commits":[{"sha":"862de8907b9397a6732512e001d3e914e81043c1","author":{"email":"242e9b49721430d64892cb47ac49218827428c9a@gmail.com","name":"liuxuan30"},"message":"round the float value before we cast to Int\n\nOld code will cause the visible index incorrect, smaller by 1.\n\nInt() simply cuts the fractional part, which usually isn't the desired behaviour ;) Int(round(f)) does the job\n\nI met this when that the last label should be year 2015, but it actually shows 2014. It turned out that pt.x is 3.9999999999999987, and Int(pt.x) is 3\n\nMore information about the casting can be found here:http://stackoverflow.com/questions/24029917/convert-float-to-int-in-swift","distinct":true,"url":"https://api.github.com/repos/liuxuan30/ios-charts/commits/862de8907b9397a6732512e001d3e914e81043c1"}]}