API reference / Quittio \ Core \ Xml
Format
final class in quittio/core
Quittio\Core\Xml\Format · Source
Number formats for XML: dot as decimal separator, no grouping, no exponent.
Methods#
| Method | Description |
|---|---|
::amount() | Amounts always with exactly two decimals. |
::percent() | Percentages with at least two decimals. |
::price() | Prices keep their precision, but at least two decimals. |
::quantity() | Quantities without superfluous trailing zeros. |
amount()#
public static function amount(Money $money): stringAmounts always with exactly two decimals.
| Parameter | Type | Description |
|---|---|---|
$money | Brick\Money\Money |
- Returns
string
percent()#
public static function percent(BigDecimal $percent): stringPercentages with at least two decimals.
| Parameter | Type | Description |
|---|---|---|
$percent | Brick\Math\BigDecimal |
- Returns
string
price()#
public static function price(BigDecimal $price): stringPrices keep their precision, but at least two decimals.
| Parameter | Type | Description |
|---|---|---|
$price | Brick\Math\BigDecimal |
- Returns
string
quantity()#
public static function quantity(BigDecimal $quantity): stringQuantities without superfluous trailing zeros.
| Parameter | Type | Description |
|---|---|---|
$quantity | Brick\Math\BigDecimal |
- Returns
string