amolmali / googlechartwrapper

Automatically exported from code.google.com/p/googlechartwrapper
0 stars 0 forks source link

GridLine - step format #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago

Original comment by steffan....@outlook.com on 1 Dec 2010 at 9:39

GoogleCodeExporter commented 9 years ago

Original comment by steffan....@outlook.com on 15 Feb 2011 at 9:35