PHP Class Cassandra\Decimal

The actual value of a decimal is $value * pow(10, $scale * -1)
Inheritance: implements cassandra\Value, implements cassandra\Numeric
Afficher le fichier Open project: datastax/php-driver

Méthodes publiques

Méthode Description
__construct ( string $value ) Creates a decimal from a given decimal string:
__toString ( ) : string String representation of this decimal.
abs ( ) : cassandra\Numeric
add ( cassandra\Numeric $addend ) : cassandra\Numeric
div ( cassandra\Numeric $divisor ) : cassandra\Numeric
mod ( cassandra\Numeric $divisor ) : cassandra\Numeric
mul ( cassandra\Numeric $multiplier ) : cassandra\Numeric
neg ( ) : cassandra\Numeric
scale ( ) : integer Scale of this decimal as int.
sqrt ( ) : cassandra\Numeric
sub ( cassandra\Numeric $subtrahend ) : cassandra\Numeric
toDouble ( ) : float
toInt ( ) : integer
type ( ) : cassandra\Type The type of this decimal.
value ( ) : string Numeric value of this decimal as string.

Method Details

__construct() public méthode

~~~{.php} assertEquals(21, $decimal->scale()); $this->assertEquals("1313123123234234234234234234123", $decimal->value()); ~~~
public __construct ( string $value )
$value string Any decimal string

__toString() public méthode

String representation of this decimal.
public __toString ( ) : string
Résultat string Decimal value

abs() public méthode

public abs ( ) : cassandra\Numeric
Résultat cassandra\Numeric absolute value

add() public méthode

public add ( cassandra\Numeric $addend ) : cassandra\Numeric
$addend cassandra\Numeric a number to add to this one
Résultat cassandra\Numeric sum

div() public méthode

public div ( cassandra\Numeric $divisor ) : cassandra\Numeric
$divisor cassandra\Numeric a number to divide this one by
Résultat cassandra\Numeric quotient

mod() public méthode

public mod ( cassandra\Numeric $divisor ) : cassandra\Numeric
$divisor cassandra\Numeric a number to divide this one by
Résultat cassandra\Numeric remainder

mul() public méthode

public mul ( cassandra\Numeric $multiplier ) : cassandra\Numeric
$multiplier cassandra\Numeric a number to multiply this one by
Résultat cassandra\Numeric product

neg() public méthode

public neg ( ) : cassandra\Numeric
Résultat cassandra\Numeric negative value

scale() public méthode

Scale of this decimal as int.
public scale ( ) : integer
Résultat integer Scale

sqrt() public méthode

public sqrt ( ) : cassandra\Numeric
Résultat cassandra\Numeric square root

sub() public méthode

public sub ( cassandra\Numeric $subtrahend ) : cassandra\Numeric
$subtrahend cassandra\Numeric a number to subtract from this one
Résultat cassandra\Numeric difference

toDouble() public méthode

public toDouble ( ) : float
Résultat float this number as float

toInt() public méthode

public toInt ( ) : integer
Résultat integer this number as int

type() public méthode

The type of this decimal.
public type ( ) : cassandra\Type
Résultat cassandra\Type

value() public méthode

Numeric value of this decimal as string.
public value ( ) : string
Résultat string Numeric value