asp exponent problem

M

mikekimhome

Hi

It seems like asp is converting -0.04 to -4.00000000000063E-02
If you run the below code it prints -4.00000000000063E-02


Is there anyway ASP to keep it as float number instead of exponet. Or
is there a function to convert exponet to float number? Thanks in
advance.

---------------------------------------------------------
<%
dim sgPoint
sgPoint = 100 - 100.04
response.write (sgPoint& "<br>")

%>
---------------------------------------------------------
 
D

Dave Anderson

It seems like asp is converting -0.04 to -4.00000000000063E-02
If you run the below code it prints -4.00000000000063E-02


Is there anyway ASP to keep it as float number instead of exponet.
Or is there a function to convert exponet to float number?

There IS no exponent type. The number is already a floating point number:
dim sgPoint
sgPoint = 100 - 100.04
response.write (sgPoint& "<br>")

Response.Write(TypeName(sgPoint)) 'Double

What you want is a string representation of the number, and FormatNumber()
will give it to you.




--
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. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top