[thelist] ASP 2.0 Functions

Michael K. Ahn mike at ahnfire.com
Fri Jul 19 09:38:01 CDT 2002


Adding 0.5 to your number and dropping the numbers after the decimal
point is usually a good trick to doing a "Round" when systems do not do
it reliably themselves.

On another note... wasn't there a specific word for the numbers after
the decimal point?  I was thinking it was "mantissa" but that has to do
with a certain part of a floating point number.

Michael

> -----Original Message-----
> From: Chris Blessing [mailto:webguy at mail.rit.edu]
> Sent: Friday, July 19, 2002 10:33 AM
> To: thelist at lists.evolt.org
> Subject: RE: [thelist] ASP 2.0 Functions
>
> Rob-
>
> Round() is a valid ASP2 function, as is int() (and fix()) which will
drop
> the fractional part of a number (like floor).  There is no ceiling()
> function IIRC, but you can use JScript's functions from within your
VB/ASP
> block by doing something like:
>
> <script runat=server langauge=JScript>
> 	yourJSFunction(inVal){
> 		return ceiling(inVal);
> 	}
> </script>
>
> I currently use this setup for ordering arrays, since the VB bubble
method
> is pretty damn slow with larger chunks and JS has the built-in
> array.sort()
> method.
>
> Also note that round() can be rather unreliable sometimes, not always
> rounding a particular number up as you would expect.  I forget why
this is
> but there's some valid reason for it.
>
> Check this out too:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-
> us/vbenlr98/ht
> ml/vafctint.asp
>
> HTH!
>
> Chris Blessing
> webguy at mail.rit.edu
> http://www.330i.net
>
> > Hi list,
> >
> > Is there anything remotely related to floor(), ceiling(), and/or
round()
> > functions in ASP 2.0
> >
> > Thanks,
> > Rob.Smith
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !



More information about the thelist mailing list