Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. if ( Math.round((change / Coin.OE.value)*10.0)/10.0 >= 1 ) {
  2.                         int oneEuro = (int)(change / Coin.OE.value);
  3.                         change = Math.round((change - (oneEuro * Coin.OE.value))*10.0)/10.0;
  4.  
  5.                         //If change is 0.1 or 0.3 at this point, we need to revert what we just did as we will end up in a situation where we cant give all money back
  6.                         if (change == 0.1 || change == 0.3) {
  7.                             change += Coin.OE.value;
  8.                             oneEuro--;
  9.                         }
  10.                         coinList[1] = (int)oneEuro;
  11.                        
  12.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement