Velocity Reviews > getting a whole number

# 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

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.

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

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!

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.

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.

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
>
>
>