人数,点赞统计(>9999人时,显示为1.00万人)
来源:互联网 发布:域名别名是什么 编辑:程序博客网 时间:2024/05/02 19:38
/**
* 人数統計
*
* @param count
* @return
*/
public String renCount(long count, Context context) {
String str;
if (count > 9999) {
str = getCountByMillionUnit(count) +"万人";
} else {
str = String.valueOf(count) + "人";
}
return str;
* 人数統計
*
* @param count
* @return
*/
public String renCount(long count, Context context) {
String str;
if (count > 9999) {
str = getCountByMillionUnit(count) +"万人";
} else {
str = String.valueOf(count) + "人";
}
return str;
}
public String getCountByMillionUnit(long number){
String str;
if (number > 9999) {
long temp1 = number / 10000;
long temp2 = number % 10000;
long temp3 = temp2 / 1000;
if(temp3 == 0){
str = String.valueOf(temp1);
}else{
str = String.valueOf(temp1)+"."+String.valueOf(temp3);
}
} else {
str = String.valueOf(number);
}
return str;
}
0 0
- 人数,点赞统计(>9999人时,显示为1.00万人)
- 人数统计
- 关于一个选举的票数统计程序,每一位候选人的记录内容均为字符0或1,1表示此人被选中,0表示此人未被选中,若一张选票选中人数大于5个人时被认为无效的选票。
- 输入某班学生(不超过40人)的某门课成绩,编程统计不及格的人数(以-1为成绩输入结束标志)
- 监听器(实现在线统计人数,踢人)
- java 统计在线人数(2)
- zzulioj--1865--统计人数(模拟)
- Servlet监听器(统计在线人数案例)
- 数据集(人数统计、密度分析)
- 9点人时候,刚刚地震了?
- 一个人时与孤独为舞
- 设置@一个人时字符串为蓝色
- 在线人数统计
- HttpSessionListener统计在线人数
- 在线人数统计
- 如何统计在线人数
- HttpSessionListener统计在线人数
- HttpSessionListener统计在线人数
- ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
- 大型网站技术架构小结
- chrome jsonView插件安装
- 你还在用for循环大法麽?
- python 使用过程问题总结
- 人数,点赞统计(>9999人时,显示为1.00万人)
- 简单理解JavaScript中的闭包
- spark笔记
- 基于JQuery的井字过三关游戏(两玩家对战)
- 正向/反向 代理
- java自定义注解
- 康复计划#5 Matrix-Tree定理(生成树计数)的另类证明和简单拓展
- The method of type must override a superclass method解决方式
- osx 解决右上角通知广告问题