Created
October 29, 2012 14:41
-
-
Save mathiasverraes/3973917 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$jim_price = $hannah_price = new Money(2500, new Euro); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$coupon = new Money(500, new Euro); | |
$jim_price->subtract($coupon); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$jim_price->equals($hannah_price); // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$jim_price = $jim_price->subtract($coupon); | |
$jim_price->lessThan($hannah_price); // true | |
$jim_price->equals(Money::euro(2000)); // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$profit = new Money(5, new Euro); | |
list($my_cut, $investors_cut) = $profit->allocate(70, 30); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list($investors_cut, $my_cut) = $profit->allocate(30, 70); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment