Google API Common Protos Client - Class Fraction (4.8.3)

Reference documentation and code samples for the Google API Common Protos Client class Fraction.

Represents a fraction in terms of a numerator divided by a denominator.

Generated from protobuf message google.type.Fraction

Namespace

Google \ Type

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ numerator int|string

The numerator in the fraction, e.g. 2 in 2/3.

↳ denominator int|string

The value by which the numerator is divided, e.g. 3 in 2/3. Must be positive.

getNumerator

The numerator in the fraction, e.g. 2 in 2/3.

Returns
Type Description
int|string

setNumerator

The numerator in the fraction, e.g. 2 in 2/3.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getDenominator

The value by which the numerator is divided, e.g. 3 in 2/3. Must be positive.

Returns
Type Description
int|string

setDenominator

The value by which the numerator is divided, e.g. 3 in 2/3. Must be positive.

Parameter
Name Description
var int|string
Returns
Type Description
$this