Overview

Namespaces

  • NGS
    • Client
      • Exception
    • Converter
    • Patterns
  • PHP

Classes

  • BigDecimal
  • BigInt
  • ByteStream
  • LocalDate
  • Location
  • Money
  • Name
  • Point
  • S3
  • Timestamp
  • Utils
  • UUID
  • Overview
  • Namespace
  • Class
  • Tree

Class Money

Represents money values Money is BigDecimal with scale value fixed to 2

NGS\BigDecimal
Extended by NGS\Money
Namespace: NGS
Located at Money.php
Methods summary
public
# __construct( NGS\Money|integer|string|float $value )

Parameters

$value
NGS\Money|integer|string|float
$value

Throws

InvalidArgumentException

Overrides

NGS\BigDecimal::__construct()
protected
# setValue( string|integer|float $value )

Rounds up

Rounds up

Parameters

$value
string|integer|float
$value

Overrides

NGS\BigDecimal::setValue()
public static array
# toArray( array $items, boolean $allowNullValuesValues = false )

Converts all elements in array to \NGS\Money instance

Converts all elements in array to \NGS\Money instance

Parameters

$items
array
$items Source array, each element must be a valid argument for Money constructor
$allowNullValuesValues
boolean
$allowNullValuesValues Allow elements with null value in array

Returns

array
Resulting \NGS\Money array

Throws

InvalidArgumentException
If any element is null or invalid type for Money constructor

Overrides

NGS\BigDecimal::toArray()
Methods inherited from NGS\BigDecimal
__get(), __toString(), _add(), _comp(), _div(), _gt(), _gte(), _lt(), _lte(), _mod(), _mul(), _pow(), _sub(), add(), comp(), div(), format(), getScale(), getValue(), gt(), gte(), lt(), lte(), mod(), mul(), pow(), round(), setScale(), sqrt(), sub(), toArrayWithScale(), toStringWith()
Constants inherited from NGS\BigDecimal
DEFAULT_SCALE
Properties summary
protected string $value
#

String representation of decimal value.

String representation of decimal value.

protected integer $scale 2
#

scale

scale

Magic properties summary
public string $value
#

String representation of money value

String representation of money value

public integer $scale
#

Extended from NGS\BigDecimal scale, fixed to 2

Extended from NGS\BigDecimal scale, fixed to 2

API documentation generated by ApiGen 2.8.0