Functiereferentie Truncate ( x, n )
| Argument | Beschrijving |
|---|---|
| x | Het getal dat u wilt afkappen. |
| n | Het aantal decimalen waarop u x wilt afkappen. Geldige waarden zijn 0 tot en met 28. |
Gegevenstype: Number Als n positief is, wordt x afgekapt op het opgegeven aantal decimalen geretourneerd. Als n negatief is, wordt x afgekapt op (- n +1) posities vóór de decimale komma geretourneerd.
Voorbeeld 1
Section titled “Voorbeeld 1”Truncate(9.22, 1)
Deze expressie retourneert 9.2
Voorbeeld 2
Section titled “Voorbeeld 2”Truncate(9.28, 1)
Deze expressie retourneert 9.2
Voorbeeld 3
Section titled “Voorbeeld 3”Truncate(9.9, 0)
Deze expressie retourneert 9
Voorbeeld 4
Section titled “Voorbeeld 4”Truncate(–9.29, 1)
Deze expressie retourneert -9.2
Voorbeeld 5
Section titled “Voorbeeld 5”Truncate(9.2, –1)
Deze expressie retourneert 0
Voorbeeld 6
Section titled “Voorbeeld 6”Truncate(54, –1)
Deze expressie retourneert 50