For Programmers: Free Programming Magazines  


Home > Archive > ASP > November 2007 > how to find quoteint in asp









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to find quoteint in asp
vinodkus@gmail.com

2007-11-16, 6:56 pm

dear sir/madam

can u tell me how to find the quoteint in asp
for e.g
290 / 100 = 2
I want result 2 but it gives 2.9
Please help me
Thanks in advance

McKirahan

2007-11-16, 6:56 pm

<vinodkus@gmail.com> wrote in message
news:1194095794.452966.292430@19g2000hsx.googlegroups.com...
> dear sir/madam
>
> can u tell me how to find the quoteint in asp
> for e.g
> 290 / 100 = 2
> I want result 2 but it gives 2.9
> Please help me
> Thanks in advance


The result is 2.9!

"In mathematics, a quotient is the end result of a division problem."
URL:http://en.wikipedia.org/wiki/Quotient

Do you want only the digits to the left of the decimal only?

Is this what your looking for?
FormatNumber(290/100-.5,0)


Dave Anderson

2007-11-16, 6:56 pm

<vinodkus@gmail.com> wrote:
> can u tell me how to find the quoteint in asp
> for e.g
> 290 / 100 = 2
> I want result 2 but it gives 2.9


ASP is not a language.

There are many possible ways to interpret your question, so I'll give you
two answers:

JScript: Math.floor(290/100)
http://msdn2.microsoft.com/en-us/library/sw6w4wz7.aspx

vbscript : 290 \ 100
http://msdn2.microsoft.com/en-us/library/bzydt0tx.aspx



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

2007-11-16, 6:56 pm

Dave Anderson wrote on 03 nov 2007 in
microsoft.public.inetserver.asp.general:

> JScript: Math.floor(290/100)


or:

(290/100)|0



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dave Anderson

2007-11-16, 6:56 pm

"Evertjan." wrote:
>
> or:
>
> (290/100)|0


Sigh. Or any of these:

parseInt(290/100,10)
Math.pow(2,Math.floor(Math.log(290/100)/Math.LN2))
String(290/100).replace(".","").length

As I said, the question can be interpreted many ways. The OP didn't even
suggest what -290/100 should yield.



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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com