Ga naar inhoud
Contact us

Truncate()

Functiereferentie Truncate ( x, n )

ArgumentBeschrijving
xHet getal dat u wilt afkappen.
nHet 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.

Truncate(9.22, 1)

Deze expressie retourneert 9.2

Truncate(9.28, 1)

Deze expressie retourneert 9.2

Truncate(9.9, 0)

Deze expressie retourneert 9

Truncate(–9.29, 1)

Deze expressie retourneert -9.2

Truncate(9.2, –1)

Deze expressie retourneert 0

Truncate(54, –1)

Deze expressie retourneert 50