Double value = item.getPrice() * loyaltyPointMultiplier;
String[] s = String.split(value.toString(), "\\.");
points = Integer.parseInt(s[0]);
if(Integer.parseInt(s[1]) > 0) {
points++;
}
return points;
Want to round up? Math.ceil() uses too little memory! Use this instead!