public class Test { public static void main(String[] args) { Double a = 12334.734; double b = a.longValue() + 0.5; Test test = new Test(); Double c = test.math(a, b); System.out.println(c.longValue()); } double math(double a, double b) { if (a > b) { a = a + 100; } a = a / 100; return a; } }应该符合楼主的要求吧..124 结果如上..
/10
+-
Math.round
等等混在一起就可以了
public static void main(String[] args) {
Double a = 12334.734;
double b = a.longValue() + 0.5;
Test test = new Test();
Double c = test.math(a, b);
System.out.println(c.longValue());
} double math(double a, double b) {
if (a > b) {
a = a + 100;
}
a = a / 100; return a; }
}应该符合楼主的要求吧..124
结果如上..