If it is always the 3rd digit from the left:
cfset thisNumber = 34859
cfset thisDigit = mid(thisNumber,3,1)
If it is always the 3rd digit from the left:
cfset thisNumber = 34859
cfset thisDigit = mid(reverse(thisNumber),3,1)
Are you trying to see if 8 is in the digits and if so get the
Mid(getdon.recordcount,2,1)
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2008 8:21 AM
To: CF-Talk
Subject: Get a digit out of large number
Hi All,
I'm trying to figure out how to grab a specific digit in a number. For
example if I have
I've got so far ...
Take a look at the mid() function.
CFSET digits = len(getdon.recordcount) to get the number
Btw, should that not be len(theNumber) instead of recordCount?
~|
Adobe® ColdFusion® 8 software 8 is the
Mid(getdon.recordcount,2,1)
This will in fact return the second digit from the left, same thing only
for 5 digit numbers.
For the third digit from the right
I would rather use this:
CFSET digits = left(right(getdon.recordcount, 3),1)
___
REUSE CODE! Use
4 matches
Mail list logo