有什么方法可以将这个计算结果放入没有小数点的价格结果中。
private void calculate() {
double b = Double.parseDouble(berat.getText().toString());
if (b <= 0.5) {
totalPrice1 = 7;
serviceFee1 = totalPrice1 * 0.2;
carierFee1 = totalPrice1 * 0.8;
} else {
totalPrice1 = b * 12.9;
serviceFee1 = totalPrice1 * 0.2;
carierFee1 = totalPrice1 * 0.8;
}
}
例如,如果我添加 0.5,则价格结果将在承运人费用中为 5.60000000000。我希望它显示为 5.60。
开心每一天1111
DIEA
拉风的咖菲猫
相关分类