Re: remove a number from a series of numbers

2007-09-12 Thread Barney Boisvert
removeChars(2007, 2, 1)

You could start at index '3' in this case since both 2 and 3 are zeros.

cheers,
barneyb

On 9/12/07, John  P [EMAIL PROTECTED] wrote:
 Hi,

 Is it possible to remove a digit from a multi-digit number IE:
 2007 would become 207?

 Thanks,

 John



 

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288290
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: remove a number from a series of numbers

2007-09-12 Thread Bryan Stevenson
Yes it is ;-)

Now you probably want to know how ;-)

There are quite a few ways to do this...someone will probably post some methods 
using regular expressionsyou can also look into the mid/right/left/replace 
functions which you can use to break apart the number and put it back together 
the way you want.

So if you can be specific on what you want to do (i.e. the patternlike 
always remove the 3rd digit as per your example)then I can fire you 
something more specific

Cheers

Bryan Stevenson B.Comm.
VP  Director of E-Commerce Development
Electric Edge Systems Group Inc.
phone: 250.480.0642
fax: 250.480.1264
cell: 250.920.8830
e-mail: [EMAIL PROTECTED]
web: www.electricedgesystems.com

Notice:
This message, including any attachments, is confidential and may contain
information that is privileged or exempt from disclosure. It is intended
only for the person to whom it is addressed unless expressly authorized
otherwise by the sender. If you are not an authorized recipient, please
notify the sender immediately and permanently destroy all copies of this
message and attachments. 



~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288288
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: remove a number from a series of numbers

2007-09-12 Thread Andy Chen
Yup... convert it to a string using the ToString(). Remove the digit/char you 
want using RemoveChars() and use Val() to convert it back into a number.


Hi, 

Is it possible to remove a digit from a multi-digit number IE:
2007 would become 207?

Thanks, 

John 

~|
Check out the new features and enhancements in the
latest product release - download the What's New PDF now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288291
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: remove a number from a series of numbers

2007-09-12 Thread C. Hatton Humphrey
 Is it possible to remove a digit from a multi-digit number IE:
 2007 would become 207?

You would have to treat the number as a string, loop over it and
rebuild the string excluding that particular character or digit space.

For your particular example:

cfset OldValue = 2007
cfset NewValue = 
cfloop from=1 to=#Len(OldValue)# index=x
cfif x NEQ 3
cfset NewValue = NewValue  Mid(OldValue, x, 1)
/cfif
/cfloop

cfoutput#OldValue# vs #NewValue#/cfoutput

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288293
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: remove a number from a series of numbers

2007-09-12 Thread Charlie Griefer
is there a particular criteria that you're looking for?

e.g. duplicate consecutive numbers?  the 2nd digit?  the 3rd digit?

On 9/12/07, John  P [EMAIL PROTECTED] wrote:
 Hi,

 Is it possible to remove a digit from a multi-digit number IE:
 2007 would become 207?

 Thanks,

 John



 

~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288289
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: remove a number from a series of numbers

2007-09-12 Thread Daniel Baughman
yea there are a lot of ways to do that..


If the digits always in the same position you could do a 

cfset newStr = left(1, '2007')  right(2, '2007')

alternatively if its the same sequence you could find/replace 

Is that not what you meant?



-Original Message-
From: John P [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 12, 2007 12:20 PM
To: CF-Talk
Subject: remove a number from a series of numbers


Hi, 

Is it possible to remove a digit from a multi-digit number IE:
2007 would become 207?

Thanks, 

John





~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288294
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: remove a number from a series of numbers

2007-09-12 Thread Claude Schneegans
 Is it possible to remove a digit from a multi-digit number IE:
2007 would become 207?

Depending of the rule you have to remove digits, you can use a regExp 
and REreplace()

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288297
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: remove a number from a series of numbers

2007-09-12 Thread Loathe
You don't need to do type conversion in ColdFusion like that.

You can just use the string functions.

 -Original Message-
 From: Andy Chen [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 12, 2007 2:30 PM
 To: CF-Talk
 Subject: Re: remove a number from a series of numbers
 
 Yup... convert it to a string using the ToString(). Remove the
 digit/char you want using RemoveChars() and use Val() to convert it
 back into a number.
 
 
 Hi,
 
 Is it possible to remove a digit from a multi-digit number IE:
 2007 would become 207?
 
 Thanks,
 
 John
 
 

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288300
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: remove a number from a series of numbers

2007-09-12 Thread Robert Harrison
 Is it possible to remove a digit from a multi-digit number IE:
 2007 would become 207?

You could read the length to get the length to get the number of digits,
Then make a decision as to which digit to remove,
Then based on that and the number of total digits decide how
many digits to read from the beginning of the string,
then use the RIGHT and LEFT string read function to get the
starting and ending digits, then concatenate the beginning and 
end reads into a single string.

If you need help with that I can put together a small program, but you
should be able to do with just a few
Cfsets and RIGHT and LEFT.

Robert B. Harrison
Director of Interactive services
Austin  Williams
125 Kennedy Drive, Suite 100 Hauppauge NY 11788
T : 631.231.6600 Ext. 119 
F : 631.434.7022
www.austin-williams.com

Great advertising can't be either/or... It must be .

Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288286
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=28801.20441.4


__ NOD32 2524 (20070912) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288298
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: remove a number from a series of numbers

2007-09-12 Thread Robert Harrison
Or you could do it with any of the other methods mentioned. There are a lot
of ways to do that.


Robert B. Harrison
Director of Interactive services
Austin  Williams
125 Kennedy Drive, Suite 100 Hauppauge NY 11788
T : 631.231.6600 Ext. 119 
F : 631.434.7022
www.austin-williams.com

Great advertising can't be either/or... It must be .




~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288301
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: remove a number from a series of numbers

2007-09-12 Thread John P
I'd like to remove the 2nd Character (zero) from the left

Thanks to all for your help. 

John


removeChars(2007, 2, 1)

You could start at index '3' in this case since both 2 and 3 are zeros.

cheers,
barneyb


 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288318
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: remove a number from a series of numbers

2007-09-12 Thread John P
I ended up using #RemoveChars(2007, 2, 1)#

Thanks!





Or you could do it with any of the other methods mentioned. There are a lot
of ways to do that.


Robert B. Harrison
Director of Interactive services
Austin  Williams
125 Kennedy Drive, Suite 100 Hauppauge NY 11788
T : 631.231.6600 Ext. 119 
F : 631.434.7022
www.austin-williams.com

Great advertising can't be either/or... It must be . 

~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288319
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4