public static function add($amountA, $amountB)
    {
        $precision = (int) self::config()->get('precision');
        if (function_exists('bcadd') && self::config()->get('useBcMath')) {
            return bcadd($amountA, $amountB, $precision);
        }

        return self::formatFloat((double)$amountA + (double)$amountB, $precision);
    }
public static function add($amountA, $amountB)
    {
        $precision = (int) self::config()->get('precision');
        if (function_exists('bcadd') && self::config()->get('useBcMath')) {
            return bcadd($amountA, $amountB, $precision);
        }

        return self::formatFloat((double)$amountA + (double)$amountB, $precision);
    }
public static function add ( $ amountA , $ amountB ) { $ precision = ( int ) self :: config ( ) -> get ( 'precision' ) ; if ( function_exists ( 'bcadd' ) && self :: config ( ) -> get ( 'useBcMath' ) ) { return bcadd ( $ amountA , $ amountB , $ precision ) ; } return self :: formatFloat ( ( double ) $ amountA + ( double ) $ amountB , $ precision ) ; }
Add two numbers that are represented as a string
Numbers will not be rounded but floored instead! So 0.22 + 0.27 with a precision of 1 will result in 0.4!
@param string $amountA first operand
@param string $amountB second operand
@return string the result as a string
Add two numbers that are represented as a string Numbers will not be rounded but floored instead! So 0 . 22 + 0 . 27 with a precision of 1 will result in 0 . 4!