Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > getting a whole number

Reply
Thread Tools

getting a whole number

 
 
le0
Guest
Posts: n/a
 
      08-08-2006
Hi Guys,

Can you help me with this? Is there any function that I can use in getting a
whole number

Example:

Input OutPut
12.3 12
1.63 1
21.1 21

Im using the function left(p1,p2) but it doesnt recognize the whole number

Please help thanks =)


 
Reply With Quote
 
 
 
 
Bobbo
Guest
Posts: n/a
 
      08-08-2006

le0 wrote:

> Can you help me with this? Is there any function that I can use in getting a
> whole number


Look up the help topics for Round, CInt and FormatNumber and decide
which is best for you to use -- it depends on what you're trying to
achieve.

 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      08-08-2006

"Bobbo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>
> le0 wrote:
>
> > Can you help me with this? Is there any function that I can use in

getting a
> > whole number

>
> Look up the help topics for Round, CInt and FormatNumber and decide
> which is best for you to use -- it depends on what you're trying to
> achieve.
>


None of the above.

Int is the function needed

Eg.

Int(1.62) = 1


 
Reply With Quote
 
Bobbo
Guest
Posts: n/a
 
      08-08-2006

Anthony Jones wrote:

>
> None of the above.
>
> Int is the function needed
>


Thanks Anthony, I stand corrected!

I -- incorrectly -- remembered that CInt behaved like that. Guess it's
been too long since I've done classic ASP!

 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      08-08-2006
Anthony Jones wrote:
> Int is the function needed
>
> Eg.
>
> Int(1.62) = 1


Depending on the desired behavior for negative numbers, yes. Otherwise Fix()
is the one.

And since this is an ASP forum, not a VBScript one, it is worth noting that
Math.floor() does the same as Int().



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      08-09-2006
Dave Anderson wrote on 08 aug 2006 in
microsoft.public.inetserver.asp.general:

> Anthony Jones wrote:
>> Int is the function needed
>>
>> Eg.
>>
>> Int(1.62) = 1

>
> Depending on the desired behavior for negative numbers, yes. Otherwise
> Fix() is the one.
>
> And since this is an ASP forum, not a VBScript one, it is worth noting
> that Math.floor() does the same as Int().


... if you are using j[ava]script as asp serverside language.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
le0
Guest
Posts: n/a
 
      08-10-2006
Thanks guys =)

"le0" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Guys,
>
> Can you help me with this? Is there any function that I can use in getting
> a whole number
>
> Example:
>
> Input OutPut
> 12.3 12
> 1.63 1
> 21.1 21
>
> Im using the function left(p1,p2) but it doesnt recognize the whole number
>
> Please help thanks =)
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
W_Tom - what is the part number/model of your whole houseprotector? Leythos Computer Support 6 03-30-2007 12:07 AM
How to Round a float to an nearest whole number Don Java 30 03-04-2007 08:23 AM
*WITHOUT* using: ValidateRequest="False" for the whole page (or my whole site).... \A_Michigan_User\ ASP .Net 2 08-21-2006 02:13 PM
OT: Number Nine, Number Nine, Number Nine FrisbeeŽ MCSE 37 09-26-2005 04:06 PM
testing whether a double is a whole number David Marsh C Programming 3 07-03-2005 04:13 PM



Advertisments