public static void main(String args[]){
double k = 1024;
double s = 4170650;
double e = (s/k)/k;
System.out.println(getRoundDouble(e));
}
//四舍五入
private static Double getRoundDouble(double unroundedValue ) {
// TODO Auto-generated method stub
double intPortion = Math.floor( unroundedValue );
double unroundedDecimalPortion = ( unroundedValue - intPortion );
double roundedDecimalPortion = Math.round( unroundedDecimalPortion * 100 );
roundedDecimalPortion = roundedDecimalPortion / 100;
double total = intPortion + roundedDecimalPortion;
return new Double( total );
}