Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android mpandoidchart无法获取十进制值格式_Android_Mpandroidchart_Decimalformat - Fatal编程技术网

Android mpandoidchart无法获取十进制值格式

Android mpandoidchart无法获取十进制值格式,android,mpandroidchart,decimalformat,Android,Mpandroidchart,Decimalformat,我正在使用。我正在使用YAxisValueFormatter在我的图表中格式化我的值,如0.00,但我得到的是简单的值,如123。而不是像123.00一样在我的值后设置两个零。 请看图片了解更多信息 您的代码看起来不错(尽管我建议使用#0.00格式,因为小于1的值将显示为.45$,而不是0.45$) 您确定已经在图表上设置了格式设置程序,如本例所示吗 YAxis leftAxis = chart.getAxisLeft(); leftAxis.setValueFormatter(new MyY

我正在使用。我正在使用
YAxisValueFormatter
在我的图表中格式化我的值,如
0.00
,但我得到的是简单的值,如
123
。而不是像
123.00
一样在我的值后设置两个零。 请看图片了解更多信息

您的代码看起来不错(尽管我建议使用
#0.00
格式,因为小于1的值将显示为
.45$
,而不是
0.45$

您确定已经在图表上设置了格式设置程序,如本例所示吗

YAxis leftAxis = chart.getAxisLeft();
leftAxis.setValueFormatter(new MyYAxisValueFormatter());
取而代之的是,

mFormat=新的十进制格式(“0.00”)

用这个

mFormat=新的十进制格式(“.00”)

它对我有用

mFormat = new DecimalFormat("###.##");

mFormat = new DecimalFormat("###.##");
mFormat = new DecimalFormat("$###.##");