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!

By phytyca, 2017-12-12 05:02:48