Zend Framework  1.12
Static Public Member Functions | Static Public Attributes | List of all members
Zend_Locale_Math Class Reference

Static Public Member Functions

static isBcmathDisabled ()
 
static round ($op1, $precision=0)
 Surprisingly, the results of this implementation of round() prove better than the native PHP round().
 
static floatalize ($value)
 Convert a scientific notation to float Additionally fixed a problem with PHP <= 5.2.x with big integers.
 
static normalize ($value)
 Normalizes an input to standard english notation Fixes a problem of BCMath with setLocale which is PHP related.
 
static localize ($value)
 Localizes an input from standard english notation Fixes a problem of BCMath with setLocale which is PHP related.
 
static exponent ($value, $scale=null)
 Changes exponential numbers to plain string numbers Fixes a problem of BCMath with numbers containing exponents.
 
static Add ($op1, $op2, $scale=null)
 BCAdd - fixes a problem of BCMath and exponential numbers.
 
static Sub ($op1, $op2, $scale=null)
 BCSub - fixes a problem of BCMath and exponential numbers.
 
static Pow ($op1, $op2, $scale=null)
 BCPow - fixes a problem of BCMath and exponential numbers.
 
static Mul ($op1, $op2, $scale=null)
 BCMul - fixes a problem of BCMath and exponential numbers.
 
static Div ($op1, $op2, $scale=null)
 BCDiv - fixes a problem of BCMath and exponential numbers.
 
static Sqrt ($op1, $scale=null)
 BCSqrt - fixes a problem of BCMath and exponential numbers.
 
static Mod ($op1, $op2)
 BCMod - fixes a problem of BCMath and exponential numbers.
 
static Comp ($op1, $op2, $scale=null)
 BCComp - fixes a problem of BCMath and exponential numbers.
 

Static Public Attributes

static $_bcmathDisabled = false
 
static $add = array('Zend_Locale_Math', 'Add')
 
static $sub = array('Zend_Locale_Math', 'Sub')
 
static $pow = array('Zend_Locale_Math', 'Pow')
 
static $mul = array('Zend_Locale_Math', 'Mul')
 
static $div = array('Zend_Locale_Math', 'Div')
 
static $comp = array('Zend_Locale_Math', 'Comp')
 
static $sqrt = array('Zend_Locale_Math', 'Sqrt')
 
static $mod = array('Zend_Locale_Math', 'Mod')
 
static $scale = 'bcscale'
 

Member Function Documentation

static Add (   $op1,
  $op2,
  $scale = null 
)
static

BCAdd - fixes a problem of BCMath and exponential numbers.

Parameters
string$op1
string$op2
integer$scale
Returns
string
static Comp (   $op1,
  $op2,
  $scale = null 
)
static

BCComp - fixes a problem of BCMath and exponential numbers.

Parameters
string$op1
string$op2
integer$scale
Returns
string
static Div (   $op1,
  $op2,
  $scale = null 
)
static

BCDiv - fixes a problem of BCMath and exponential numbers.

Parameters
string$op1
string$op2
integer$scale
Returns
string
static exponent (   $value,
  $scale = null 
)
static

Changes exponential numbers to plain string numbers Fixes a problem of BCMath with numbers containing exponents.

Parameters
integer$valueValue to erase the exponent
integer$scale(Optional) Scale to use
Returns
string
static floatalize (   $value)
static

Convert a scientific notation to float Additionally fixed a problem with PHP <= 5.2.x with big integers.

Parameters
string$value
static isBcmathDisabled ( )
static
static localize (   $value)
static

Localizes an input from standard english notation Fixes a problem of BCMath with setLocale which is PHP related.

Parameters
integer$valueValue to normalize
Returns
string Normalized string without BCMath problems
static Mod (   $op1,
  $op2 
)
static

BCMod - fixes a problem of BCMath and exponential numbers.

Parameters
string$op1
string$op2
Returns
string
static Mul (   $op1,
  $op2,
  $scale = null 
)
static

BCMul - fixes a problem of BCMath and exponential numbers.

Parameters
string$op1
string$op2
integer$scale
Returns
string
static normalize (   $value)
static

Normalizes an input to standard english notation Fixes a problem of BCMath with setLocale which is PHP related.

Parameters
integer$valueValue to normalize
Returns
string Normalized string without BCMath problems
static Pow (   $op1,
  $op2,
  $scale = null 
)
static

BCPow - fixes a problem of BCMath and exponential numbers.

Parameters
string$op1
string$op2
integer$scale
Returns
string
static round (   $op1,
  $precision = 0 
)
static

Surprisingly, the results of this implementation of round() prove better than the native PHP round().

For example, try: round(639.795, 2); round(267.835, 2); round(0.302515, 5); round(0.36665, 4); then try: Zend_Locale_Math::round('639.795', 2);

static Sqrt (   $op1,
  $scale = null 
)
static

BCSqrt - fixes a problem of BCMath and exponential numbers.

Parameters
string$op1
integer$scale
Returns
string
static Sub (   $op1,
  $op2,
  $scale = null 
)
static

BCSub - fixes a problem of BCMath and exponential numbers.

Parameters
string$op1
string$op2
integer$scale
Returns
string

Member Data Documentation

$_bcmathDisabled = false
static
$add = array('Zend_Locale_Math', 'Add')
static
$comp = array('Zend_Locale_Math', 'Comp')
static
$div = array('Zend_Locale_Math', 'Div')
static
$mod = array('Zend_Locale_Math', 'Mod')
static
$mul = array('Zend_Locale_Math', 'Mul')
static
$pow = array('Zend_Locale_Math', 'Pow')
static
$scale = 'bcscale'
static
$sqrt = array('Zend_Locale_Math', 'Sqrt')
static
$sub = array('Zend_Locale_Math', 'Sub')
static