[cfaussie] Re: what's the 'proper way' to remove comma formatting from numbers

2006-04-06 Thread Brett Payne-Rhodes


It would have to be replace(string, substring1, substring2, scope)

B)


Kay Smoljak wrote:
 Hey guys,
 
 I can think of all sorts of ways to actually do it, but what's the
 most correct/bulletproof way to turn 10,000 into 1?
 
 --
 Kay Smoljak
 http://kay.zombiecoder.com/
 
  
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~--~~~~--~~--~--~---



[cfaussie] Re: what's the 'proper way' to remove comma formatting from numbers

2006-04-06 Thread Dale Fraser

cfset myNumber = replace(myNumber, ,, , ALL) /

Regards
Dale Fraser

 -Original Message-
 From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Kay Smoljak
 Sent: Friday, 7 April 2006 11:35 AM
 To: cfaussie@googlegroups.com
 Subject: [cfaussie] what's the 'proper way' to remove comma formatting
 from numbers
 
 
 Hey guys,
 
 I can think of all sorts of ways to actually do it, but what's the
 most correct/bulletproof way to turn 10,000 into 1?
 
 --
 Kay Smoljak
 http://kay.zombiecoder.com/
 
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~--~~~~--~~--~--~---



[cfaussie] Re: what's the 'proper way' to remove comma formatting from numbers

2006-04-06 Thread Adam Chapman

Hi Kay,

I like a regular expression for this sort of thing.. but it's just
personal preference as I am often turning $10,000 into 1. I will
also turn $10,000.00 into 1.00

reReplace(string,[^0-9.],,all)

This will remove anything that isn't a number or a . (leaving decimal
points in place)

Cheers,
Adam

-Original Message-
From: Kay Smoljak [mailto:[EMAIL PROTECTED] 
Sent: Friday, 7 April 2006 11:35 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] what's the 'proper way' to remove comma formatting
from numbers


Hey guys,

I can think of all sorts of ways to actually do it, but what's the
most correct/bulletproof way to turn 10,000 into 1?

--
Kay Smoljak
http://kay.zombiecoder.com/



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~--~~~~--~~--~--~---



[cfaussie] Re: what's the 'proper way' to remove comma formatting from numbers

2006-04-06 Thread Barry Beattie

LSParseCurrency (yes, you don't have currency but it would work here too)

gets rid of pound signs, euro, $, commas, etc and turns the number
into a decimal to four places.

..IIRC

HTH
barry.b

On 4/7/06, Adam Chapman [EMAIL PROTECTED] wrote:

 Hi Kay,

 I like a regular expression for this sort of thing.. but it's just
 personal preference as I am often turning $10,000 into 1. I will
 also turn $10,000.00 into 1.00

 reReplace(string,[^0-9.],,all)

 This will remove anything that isn't a number or a . (leaving decimal
 points in place)

 Cheers,
 Adam

 -Original Message-
 From: Kay Smoljak [mailto:[EMAIL PROTECTED]
 Sent: Friday, 7 April 2006 11:35 AM
 To: cfaussie@googlegroups.com
 Subject: [cfaussie] what's the 'proper way' to remove comma formatting
 from numbers


 Hey guys,

 I can think of all sorts of ways to actually do it, but what's the
 most correct/bulletproof way to turn 10,000 into 1?

 --
 Kay Smoljak
 http://kay.zombiecoder.com/



 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~--~~~~--~~--~--~---



[cfaussie] Re: what's the 'proper way' to remove comma formatting from numbers

2006-04-06 Thread Kay Smoljak

On 4/7/06, Barry Beattie [EMAIL PROTECTED] wrote:
 LSParseCurrency (yes, you don't have currency but it would work here too)

Bingo! This is what I was thinking there must be. A built in function
that does it by design.

Thanks Barry! (well, thanks everyone else too, but I think this is the
best answer).

--
Kay Smoljak
http://kay.zombiecoder.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~--~~~~--~~--~--~---