Implementation method of Android limiting display of two decimal places

Two methods can be used to limit the display of two decimal places after the decimal point on Android (those used by individuals in the project do not mean that they are the only two, and there are many more). Well, don't talk more nonsense. Let's go to the content.

1. Method 1: use decimalformat API

2. The second method: use the string. Split() function

OK, that's the two limit I used to show two places after decimal point. There must be others. Welcome to make complaints about it. Ha ha ~ ~

The above implementation method of Android limiting the display of two decimal places is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>