SequoiaDB
 All Classes Files Functions Variables Pages
Public Member Functions | List of all members
SequoiaDecimal Class Reference

Public Member Functions

 __construct ($decimal, $precision=-1, $scale=-1)
 
 __toString ()
 

Detailed Description

Class for create an object of the decimal type

Constructor & Destructor Documentation

SequoiaDecimal::__construct (   $decimal,
  $precision = -1,
  $scale = -1 
)

Constructor.

Parameters
string | integer | double$decimaldecimal number
integer$precisionis the precision of decimal, if not limit precision, then $precision $scale is -1.
integer$scaleis the scale of decimal, if not limit precision, then $precision $scale is -1.
$decimalObj = new SequoiaDecimal( '1000.123456', 20, 6 ) ;
$arr = array( 'money' => $decimalObj ) ; // json ==> { "money": { "$decimal": "1000.123456", "$precision": [ 20, 6 ] } }

Member Function Documentation

SequoiaDecimal::__toString ( )

PHP Magic Methods, the class as string output.

Returns
decimal string
$decimalObj = new SequoiaDecimal( '1000.123456' ) ;
echo $decimalObj ; // output ==> 1000.123456

The documentation for this class was generated from the following file: