百分比
来源:互联网 发布:java时间的加减 编辑:程序博客网 时间:2024/06/11 18:34
package test;
import java.text.NumberFormat;
public class PollTest {
/**
* @param args
*/
public static void main(String[] args) {
percent(79,1856);
percent(55,99);
percent(96,99);
}
public static String percent( double p1, double p2)
{
String str;
double p3 = p1 / p2;
NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMinimumFractionDigits( 0 );
str = nf.format(p3);
System.out.println(str);
return str;
}
}
//注意0的情况
- 百分比
- 百分比
- 百分比
- 百分比
- 百分比
- 百分比进度条
- 计算百分比
- java 百分比
- 统计百分比
- java 百分比
- 圆弧百分比
- 圆环百分比
- 百分比布局
- 百分比布局
- 百分比布局
- margin百分比
- 百分比布局
- 百分比布局
- jsp:useBean setProperty getProperty
- Interface 和 abstract class 区别
- C#中new关键字的真正含义
- 各种的web页的格式
- 连盐连淮铁路年内开工 灌南通铁路梦想即将实现
- 百分比
- Oracle表空间设计理念
- Subversion简明手册--使用hook
- php生成静态页相关问题
- 泛型算法系列29:unique()&&unique_copy()
- SetTimer and KillTimer
- CListCtrl问答!
- 模式和框架
- cookier的使用