Hi All,
I'm trying to figure out how to grab a specific digit in a number. For example
if I have
34859, I want to grab the third digit from the right or 8 for evaluation. How
do I do this?
I've got so far ...
CFSET digits = len(getdon.recordcount) to get the number
The I could use right
the location
or something?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2008 9: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 34859, I
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
5 matches
Mail list logo