The following worked for me. Just change [numb] to your string variable.
<CFSET Numb = "16,511.00">
<CFOUTPUT>#Numb#</CFOUTPUT>
<!--- This outputs 16,511.00 --->
<CFSET Numb= #LSParseNumber(Numb)#>
<CFOUTPUT>#Numb#</cfoutput>
<!--- This outputs 16511 --->
-----Original Message-----
From: Ben Lowndes [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 19, 2000 10:06 AM
To: [EMAIL PROTECTED]
Subject: Re: Reformatting number
Hi,
sorry to post the same message again but its Friday afternoon and my brain
is tired.
I've got a value 16,511.00 which although it looks like an int, CF believes
its a string. So I can't use NumberFormat.
I need to turn 16,511.00 into the integer 16511.
How?
Also can anyone recommend a good resource for learning about regular
expressions?
Thanks again
Ben
----- Original Message -----
From: "Ben Lowndes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 19, 2000 1:02 PM
Subject: Re: Reformatting number
> When I do : #NumberFormat(MyVar)#
>
> It gives an error that myVar is not a number.... but I selected it from an
> int id feild.
>
> Is there any way of testing for the format of a variable?
>
> Thanks
> Ben
>
>
> ----- Original Message -----
> From: "Stephen Moretti" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, May 19, 2000 11:33 AM
> Subject: RE: Reformatting number
>
>
> > >
> > > hi,
> > >
> > > I've got a number in the form of 16,511.00
> > > I'd like to convert it to just 16511
> > > As SQL doesn't seem to like it in the first format, even though
> > > I'm getting
> > > the number from SQL in that format.
> > >
> >
> > Morning Ben,
> >
> > The function you're after is NumberFormat.
> >
> > Regards
> >
> > Stephen
>
> --------------------------------------------------------------------------
> ----
> > Archives: http://www.eGroups.com/list/cf-talk
> > To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.