Round number
Double a = (Double) Math.round(3.144444) => a =3.0;
Double a = (Double) Math.round(3.51) => a =4.0;
Double a = (Double) Math.round(3.49) => a =3.0;
Double a = (Double) Math.floor(3.144444) => a =3.0; Round down
Double a = (Double) Math.floor(3.99) => a =3.0; Round down
Double a = (Double) Math.ceil(3.144444) => a =4.0; Round up
0 comments:
Post a Comment