View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > IncrementValue PreviousNext

IncrementValue

Adds one to an integer.

The integer part of number, incremented by one.

Mathematical functions

IncrementValue(number)

DecrementValue

Parameter

Description

number

Number to increment

<h3>IncrementValue Example</h3>
<p>Returns the integer part of a number incremented by one.
<p>IncrementValue(0): <cfoutput>#IncrementValue(0)#</cfoutput>
<p>IncrementValue("1"): <cfoutput>#IncrementValue("1")#</cfoutput>
<p>IncrementValue(123.35): <cfoutput>#IncrementValue(123.35)#</cfoutput>

Contents > CFML Reference > ColdFusion Functions > IncrementValue PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


mindtrap said on Nov 8, 2004 at 1:26 PM :
Is this function actually faster than doing:

i = i +1;
mindtrap said on Nov 8, 2004 at 2:18 PM :
Well it seems inconclusive. On average the IncrementValue() function is faster, but sometimes i=i+1 will get a performance boost. So if you have only one loop in a critical area, I would suggest you use IncrementValue().
kabbi~thkek said on Sep 30, 2005 at 5:04 AM :
Is there a function to inrease a value with 1 but in the following way:

001 / 999 instead of counting like 1 / 999

Gr,
CaptainPalapa said on Apr 26, 2006 at 5:31 AM :
There's no built in function, but you can do what I do:

If you know it's only three places max, do this or some variation of it:

right("@000" & i, 3)

This gets you 001, 034, 567. These will be strings, though,

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/funct118.htm