decrementValue

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

decrementValue(number) → returns numeric

Argument Reference

number numeric
Required

Examples
Sample code invoking the decrementValue function

decrementValue(7)

Expected Result: 6

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)

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub