Because the result of NumberFormat is a string - you can't do a numeric
comparison that way.  Try this instead:

<cfset diff2 = (((40198.12-268.56)/268.56)*100)>

 <cfif #diff2# GT 0>

 <font  color="green">

 <cfelse>

 <font color="red">

 </cfif>

 #diff2#%

 </font>


Howie Hamlin
--
inFusion Project Manager; On-Line Data Solutions, Inc. (631)737-4668
===================================================
Please vote for iMS in the Most Innovative category here:
*** http://www.sys-con.com/ColdFusion/readerschoice2000/ ***
===================================================
Check out inFusion Mail Server - the world's most configurable email server
*** inFusion Authenticator for IIS is now released! (download from
CoolFusion.com) ***
http://www.teletrends.com and http://www.coolfusion.com
Software and utilities for ColdFusion, iHTML, Website, NTMail
Latest versions available from our web site (inFusion Authenticator version
2.0 for WebSite and NTMail is now released)

----- Original Message -----
From: Robert Everland <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 08, 2000 3:31 PM
Subject: Problem with CF recognizing a number


> When I do the following it chooses the font as green. Can someone tell me
> why it is doing this I can not figure it out for the life of me.
> <cfset diff2 = #numberformat((((40198.12-268.56)/268.56
> )*100),'_-,___,___.00')#>
>
> <cfif #diff2# GT "0">
>
> <font  color="green">
>
> <cfelse>
>
> <font color="red">
>
> </cfif>
>
> #diff2#%
>
> </font>
>
> Robert Everland III
> Web Developer
> Dixon Ticonderoga
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 08, 2000 2:31 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Stupid question: How to handle $ values?
>
>
>
> Try Val(Replace("$23.12", "$", "", "ALL"))
>
> --Katrina
>
> ====================
> Katrina Chapman
> Consultant
> Ameriquest Mortgage
>
>
>
>
>                     Reuben King
>
>                     <reuben.king@        To:     [EMAIL PROTECTED]
>
>                     sbti.com>            cc:
>
>                                          Subject:     Stupid question: How
> to handle $ values?
>                     05/08/00
>
>                     10:36 AM
>
>                     Please
>
>                     respond to
>
>                     cf-talk
>
>
>
>
>
>
>
>
> If I try to use val("$23.12"), it returns 0.  Other than doing a check
> for the first character being a dollar sign, is there an easier way to
> do this?
>
> Thanks,
> -RK
> --------------------------------------------------------------------------
--
> --
>
> 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.

Reply via email to