java计算两数百分比方法

    技术2022-05-11  83

    public   static  String percent( double  p1,  double  p2)     {    String str;    double  p3  =  p1  /  p2;    NumberFormat nf  =  NumberFormat.getPercentInstance();    nf.setMinimumFractionDigits( 1 );    str  =  nf.format(p3);    return  str;   }  

    最新回复(0)