Skip to content

GridLine - step format #21

@GoogleCodeExporter

Description

@GoogleCodeExporter
Function CutNumber round badly float numbers.

Use GridLineBuilder constructor with value 9.0909

example new GridLine.GridLineBuilder(9.0909, 10);

Result for graph is 9, but should be at least 9.09.

You should preserve at least 2 places after point.

Solution could be

NumberFormat numberFormatClone = (NumberFormat) numberFormatEnglish.clone();// 
english format for point (czech format has comma)

// placesMin and placesMax could be as parameter or configuration
numberFormatClone.setMinimumFractionDigits(placesMin);
numberFormatClone.setMaximumFractionDigits(placesMax);

// result
return numberFormatClone.format(number);

placesMin and placesMax = 2, formats 9.0909 as 9.09.

Jiří (CZ)



Original issue reported on code.google.com by idr...@gmail.com on 29 Oct 2010 at 2:35

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions