Avoid floating point precision problems in chart scale