Created
November 22, 2011 10:24
-
-
Save cakper/1385372 to your computer and use it in GitHub Desktop.
set get amount
This file contains 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
<?php | |
/** | |
* Set amount | |
* | |
* @param bigint $amount | |
*/ | |
public function setAmount($amount) | |
{ | |
if (is_int($amount) || is_float($amount)) | |
{ | |
$this->amount = $amount * Currency::ACCURACY; | |
} | |
else | |
{ | |
$this->amount = $amount; | |
} | |
} | |
/** | |
* Get amount | |
* | |
* @return bigint | |
*/ | |
public function getAmount() | |
{ | |
if (is_int($this->amount) || is_float($this->amount)) | |
{ | |
return $this->amount / Currency::ACCURACY; | |
} | |
return $this->amount; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment