1.1萬咕娄、9999.9萬腾么、1.1億奈梳、999億+
* 播放量的數(shù)字顯示規(guī)則
1-9999,按照實際數(shù)字顯示
10000-9999999解虱,按照1萬攘须、1.1萬、9999.9萬
100000000-99900000000殴泰,按照1億于宙、1.1億、999億
>99900000000悍汛,統(tǒng)一顯示為999億+
所有數(shù)字顯示均保留到小數(shù)點后一位即可
```java
/**
* 視頻觀看次數(shù)捞魁、評論數(shù)
*
* @paramtimes
* @return
*/
public static String watchNum(String times) {
? ? String timeStr= "";
? ? long count= 0;
? ? try {
? ? ? ? count= Long.parseLong(times);
? ? } catch (NumberFormatException e) {
? ? ? ? return timeStr;
? ? }
? ? if (count== 0) {
? ? ? ? return timeStr;
? ? } else if (count< 10000) {
? ? ? ? return times;
? ? } else if (count< 999 * 100000) {
? ? ? ? long start= count/ 10000;
? ? ? ? long end= count% 10000 / 1000;
? ? ? ? if (end== 0) {
? ? ? ? ? ? timeStr= start+ "萬";
? ? ? ? } else {
? ? ? ? ? ? timeStr= start+ "." + end+ "萬";
? ? ? ? }
? ? ? ? return timeStr;
? ? } else if (count<= 999 * 100000000) {
? ? ? ? long start1= count/ 100000000;
? ? ? ? long end1= count% 100000000 % 1000000;
? ? ? ? if (end1== 0) {
? ? ? ? ? ? timeStr= start1+ "億";
? ? ? ? } else {
? ? ? ? ? ? String s= String.valueOf(end1);
? ? ? ? ? ? timeStr= start1+ "." + s.charAt(0) + "億";
? ? ? ? }
? ? ? ? //return "999萬+";
? ? } else if (count> 999 * 100000000) {
? ? ? ? return "999.9億+";
? ? }
? ? return timeStr;
}
```