Way her business runs. I'm just the programmer..
-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz]
Sent: Tuesday, January 27, 2009 4:10 PM
To: cf-community
Subject: Re: strip a decimal
>
> > like 2.50 need it to be stored as 2.
Out of curiosity... why do yo
The rounding works for the client so that's all I need. Thanks!
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive
>
> > like 2.50 need it to be stored as 2.
Out of curiosity... why do you need to only store the whole part of the
number without any rounding?
I could (maybe) understand rounding a dollar figure but ignoring the cents
altogether seems really strange to me.
~
Tuesday, January 27, 2009 3:39 PM
> To: cf-community
> Subject: Re: strip a decimal
>
> What about treating the number as a string, with two elements, with
> dots as delimiters? The first one (which is a whole number), then
> take the first char (Left()) of the second one, test i
nuary 27, 2009 3:39 PM
To: cf-community
Subject: Re: strip a decimal
What about treating the number as a string, with two elements, with
dots as delimiters? The first one (which is a whole number), then
take the first char (Left()) of the second one, test if it is >=5 or
<5, and either leavin
If you always want to go to the closest integer below the number put
in, use the function Fix()
If you want to go up or down based on whether it is .5 or greater or
less, then use Round()
Judah
On Tue, Jan 27, 2009 at 12:32 PM, Scott Raley -ITC wrote:
> Okay I have a value that I need to conver
the cf floor function
int=int(dec)
or if you want to be tricky
int=listFirst(dec,".")
On Tue, Jan 27, 2009 at 3:32 PM, Scott Raley -ITC wrote:
> Okay I have a value that I need to convert to a whole number if a decimal
> is
> put in.. like 2.50 need it to be stored as 2. I have javascript code
What about treating the number as a string, with two elements, with
dots as delimiters? The first one (which is a whole number), then
take the first char (Left()) of the second one, test if it is >=5 or
<5, and either leaving the first element, or adding one to it?
Coming from a non-mathematical
Okay I have a value that I need to convert to a whole number if a decimal is
put in.. like 2.50 need it to be stored as 2. I have javascript code to do
this but looking for the cf code and trying to use the find replace
functions but all that is doing is changing 2.50 to 250.. this has to work
in c