Skip to content

Instantly share code, notes, and snippets.

@cakper
Created November 22, 2011 10:24
Show Gist options
  • Save cakper/1385372 to your computer and use it in GitHub Desktop.
Save cakper/1385372 to your computer and use it in GitHub Desktop.
set get amount
<?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