decrementValue

Decrements the integer part of a number. Same as x=x-1 or x--

decrementValue(number) → returns numeric

decrementValue Argument Reference

number numeric
Required

Examples sample code invoking the decrementValue function


Decrement 7

decrementValue(7)

Expected Result: 6


Decrement 7.5

There is a difference between CFML engines. ACF will return the integer decremented removing the decimal part, returns 6. Lucee will decrement the integer part but return both, returns 6.5.

decrementValue(7.5)

Fork me on GitHub