Float to Double on entry
Why you are using float on entry? Maybe you can use Double instead of float.
I am stuck now, i need to display big number in Pie Chart. Because of float entry I can't.. Any solutions?
+1
+2
+1
Just use BigDecimal, then use .floatValue() on that and you will be able to use entry.
Still didn't work @Specko93
double d = detail.getValue();//162444145
BigDecimal bigDecimal = new BigDecimal(d);
Log.i("hello", bigDecimal + "");//162444145
Log.i("hello", bigDecimal.floatValue() + "");//1.6244414E8
entry = new Entry(bigDecimal.floatValue(), i);//162444144 //showing on the line chart value
@ratikanta-sdrc Strange.. It worked for me. Let me try it when I get home. I will post you my code.
i send a list(Double) and new barEntry(float x, float y, data) ,i order data is 0,1,2,3...then getformatter() reture list.get(entry.getdata),i solved by this way
for (int i = 0, n = yAxisValue.size(); i < n; ++i) { entries.add(new BarEntry(i, yAxisValue.get(i),i)); }
data.setValueFormatter(new IValueFormatter() { @Override public String getFormattedValue(float value, Entry entry, int i, ViewPortHandler viewPortHandler) { return String.valueOf(list.get(entry.getData())); } });
This is indeed an issue as Float tends to lose precision. Anyone who successfully forked this library and improve the Entry?