SHARE
TWEET

Untitled

a guest Jul 12th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public int getPrice(long duration){
  2.         if (this.tariff != null){
  3.             if (tariff.getFreeMinutes() > TimeUnit.MILLISECONDS.toMinutes(duration)) return 0;
  4.             else if (tariff.getPrepaidMinutes() + tariff.getFreeMinutes() > TimeUnit.MILLISECONDS.toMinutes(duration)) return tariff.getPrepaymentAmount();
  5.             return (int) ((TimeUnit.MILLISECONDS.toMinutes(duration) - (tariff.getPrepaidMinutes() + tariff.getFreeMinutes()) + 1) * tariff.getPricePerMinute()) + tariff.getPrepaymentAmount();
  6.         }
  7.         return 0;
  8.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top