PHP 클래스 Cassandra\Decimal

The actual value of a decimal is $value * pow(10, $scale * -1)
상속: implements cassandra\Value, implements cassandra\Numeric
파일 보기 프로젝트 열기: datastax/php-driver

공개 메소드들

메소드 설명
__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.

메소드 상세

__construct() 공개 메소드

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

__toString() 공개 메소드

String representation of this decimal.
public __toString ( ) : string
리턴 string Decimal value

abs() 공개 메소드

public abs ( ) : cassandra\Numeric
리턴 cassandra\Numeric absolute value

add() 공개 메소드

public add ( cassandra\Numeric $addend ) : cassandra\Numeric
$addend cassandra\Numeric a number to add to this one
리턴 cassandra\Numeric sum

div() 공개 메소드

public div ( cassandra\Numeric $divisor ) : cassandra\Numeric
$divisor cassandra\Numeric a number to divide this one by
리턴 cassandra\Numeric quotient

mod() 공개 메소드

public mod ( cassandra\Numeric $divisor ) : cassandra\Numeric
$divisor cassandra\Numeric a number to divide this one by
리턴 cassandra\Numeric remainder

mul() 공개 메소드

public mul ( cassandra\Numeric $multiplier ) : cassandra\Numeric
$multiplier cassandra\Numeric a number to multiply this one by
리턴 cassandra\Numeric product

neg() 공개 메소드

public neg ( ) : cassandra\Numeric
리턴 cassandra\Numeric negative value

scale() 공개 메소드

Scale of this decimal as int.
public scale ( ) : integer
리턴 integer Scale

sqrt() 공개 메소드

public sqrt ( ) : cassandra\Numeric
리턴 cassandra\Numeric square root

sub() 공개 메소드

public sub ( cassandra\Numeric $subtrahend ) : cassandra\Numeric
$subtrahend cassandra\Numeric a number to subtract from this one
리턴 cassandra\Numeric difference

toDouble() 공개 메소드

public toDouble ( ) : float
리턴 float this number as float

toInt() 공개 메소드

public toInt ( ) : integer
리턴 integer this number as int

type() 공개 메소드

The type of this decimal.
public type ( ) : cassandra\Type
리턴 cassandra\Type

value() 공개 메소드

Numeric value of this decimal as string.
public value ( ) : string
리턴 string Numeric value