Attention
TYPO3 v9 has reached its end-of-life September 30th, 2021 and is not
maintained by the community anymore. Looking for a stable version?
Use the version switch on the top left.
You can order Extended Long Term Support (ELTS) here:
TYPO3 ELTS.
round
With this property you can round the value up, down or to a certain
number of decimals. For each roundType the according PHP function will
be used.
The value will be converted to a float value before applying the
selected round method.
roundType
- Property
roundType
- Data type
string / stdWrap
- Description
Round method which should be used.
Possible keywords:
- ceil
Round the value up to the next integer.
- floor
Round the value down to the previous integer.
- round
Round the value to the specified number of decimals.
- Default
round
decimals
- Property
decimals
- Data type
integer / stdWrap
- Description
Number of decimals the rounded value will have. Only used with the
roundType "round". Defaults to 0, so that your input will in that case
be rounded up or down to the next integer.
- Default
0
round
- Property
round
- Data type
boolean
- Description
Set round = 1 to enable rounding.
- Default
0
Examples
lib.number = TEXT
lib.number {
value = 3.14159
stdWrap.round = 1
stdWrap.round.roundType = round
stdWrap.round.decimals = 2
}
This returns 3.14.