getting a whole number

L

le0

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 =)
 
B

Bobbo

le0 said:
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.
 
A

Anthony Jones

Bobbo said:
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
 
B

Bobbo

Anthony said:
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! :)
 
D

Dave Anderson

Anthony said:
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().
 
E

Evertjan.

Dave Anderson wrote on 08 aug 2006 in
microsoft.public.inetserver.asp.general:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top