MoneyToLocalizedStringTransformer
class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransformer
Transforms between a normalized format and a localized money string.
Constants
ROUND_CEILING |
Rounds a number towards positive infinity. Rounds 1.4 to 2 and -1.4 to -1. |
ROUND_FLOOR |
Rounds a number towards negative infinity. Rounds 1.4 to 1 and -1.4 to -2. |
ROUND_UP |
Rounds a number away from zero. Rounds 1.4 to 2 and -1.4 to -2. |
ROUND_DOWN |
Rounds a number towards zero. Rounds 1.4 to 1 and -1.4 to -1. |
ROUND_HALF_EVEN |
Rounds to the nearest number and halves to the next even number. Rounds 2.5, 1.6 and 1.5 to 2 and 1.4 to 1. |
ROUND_HALF_UP |
Rounds to the nearest number and halves away from zero. Rounds 2.5 to 3, 1.6 and 1.5 to 2 and 1.4 to 1. |
ROUND_HALF_DOWN |
Rounds to the nearest number and halves towards zero. Rounds 2.5 and 1.6 to 2, 1.5 and 1.4 to 1. |
ROUND_HALFEVEN |
Alias for {@link self::ROUNDHALFEVEN}. |
ROUND_HALFUP |
Alias for {@link self::ROUNDHALFUP}. |
ROUND_HALFDOWN |
Alias for {@link self::ROUNDHALFDOWN}. |
Methods
No description
Transforms a normalized format into a localized money string.
Transforms a localized money string into a normalized format.
Details
at line line 26
__construct($scale = 2, $grouping = true, $roundingMode = self::ROUND_HALF_UP, $divisor = 1)
at line line 55
mixed
transform(mixed $value)
Transforms a normalized format into a localized money string.
at line line 78
mixed
reverseTransform(mixed $value)
Transforms a localized money string into a normalized format.