Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number formatiing

Status
Not open for further replies.

krappleby025

Programmer
Sep 6, 2001
347
NL
Hi everyone,

I am using a simple sytem to take a number and devide it by 31 However i end up with a result like this

6.45161290322581E

can you please tell me how to change this number into a full figure only

ie in this case the figure i want is 6

to display that figure above, i use the following code

<% =sitehitsnumber / 31 %>

this is so that you can use the details to set up the equasion

thanks
 
Use FormatNumber(yournumber,0) to round to the nearest number or use Split if you use need the number upto the decimal point Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
This is the error i get any ideas

Microsoft VBScript compilation error '800a0414'

Cannot use parentheses when calling a Sub

/secure/adminpanel.asp, line 87

FormatNumber (sitehitsavenot,0)
-------------------------------^

thanks
 
hey use this
Round(6.45161290322581E,0)
it will sove your problem

Bye

Prasad
sawantprasad2001@yahoo.com
 
You need to set your variable = to the function you are calling, otherwise it assume you are trying to execute a sub, ie
Code:
Dim myNumber
myNumber=6.1234896286
myNumber = Round(myNumber)
-Tarwn &quot;The problem with a kludge is eventually you're going to have to back and do it right.&quot; - Programmers Saying (The Wiz Biz - Rick Cook)
&quot;Your a geek!&quot; - My Girlfriends saying
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top