AbstractUnit

abstract class AbstractUnit implements UnitInterface

Methods summary

Return Type Method Name Description
__construct($name, $singlePerUnitName = null, $pluralPerUnitName = null, $prefix = null, $suffix = null) -
string name() -
string perUnitName($value) -
string prefix() -
string suffix() -
decorate($value) -
float|int roundForType(string|float|int $value) -
string formatForType(string|float|int $value) -
string type() Type of data; ie microtime, float, int, currency

Details

__construct ($name, $singlePerUnitName = null, $pluralPerUnitName = null, $prefix = null, $suffix = null)

Parameters

$name
$singlePerUnitName
$pluralPerUnitName
$prefix
$suffix

string name ()

Return Value

string

string perUnitName ($value)

Parameters

$value

Return Value

string

string prefix ()

Return Value

string

string suffix ()

Return Value

string

decorate ($value)

Parameters

$value

float|int roundForType (string|float|int $value)

Parameters

string|float|int $value

Return Value

float|int

string formatForType (string|float|int $value)

Parameters

string|float|int $value

Return Value

string

abstract string type ()

Type of data; ie microtime, float, int, currency

Return Value

string