Is there any way that i can put this calculation into the price result without decimal.
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;
}
}
for example if i add 0.5 the price result will be in the carrier fee is 5.60000000000. I want that will be display as 5.60.