473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

asp exponent problem

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

%>
---------------------------------------------------------

Mar 20 '06 #1
2 2668
Ben
Hi, Use FormatNumber...

Response.Write (formatnumber(sgPoint,2))

Mar 20 '06 #2
mi*********@gmail.com wrote:
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.
Mar 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bryan | last post by:
is there a way to make the Decimal class not print the exponent version of the decimal? >>> str(Decimal('1010')) '1010' >>> str(Decimal((0, (1, 0, 1), 1))) '1.01E+3' >>>
1
by: adahili | last post by:
Hi, I use cout to print numbers in scientific notation. I noticed that a number like 12.34 is sometimes (compiler-dependent) printed as 1.234e+1 or 1.234e+01 or 1.234e+001. Since I know the...
9
by: Joseph Aldred | last post by:
I am new to C and I am writing a program for a class I am taking. I need to use a exponent but I can not figure how to do it. I figure I need to use exp() or pow() but I can not figure out how to...
5
by: sankar | last post by:
Hi, I am using a Q14.18 value. There are tables used in my program which are being indexed by the exponent and mantissa parts of the corresponding floating point value. So how can I get the...
2
by: Jens Bloch Helmers | last post by:
How can I control the number of digits in the exponent when writing floats to a file? It seems that Python2.4.2(winXP) prints three digits anyway. >>> print 1.0e50 1e+050 >>> print '%e' %...
11
by: Protoman | last post by:
I'm getting a compilation error with this program, something about the instation of invArg; here's the code: #include <iostream> #include <cstdlib> using namespace std; template<class T>...
6
by: hrbigelow | last post by:
hi, i was wondering if anyone has ever seen a floating point library that uses at least 20 bits to represent the exponent, rather than the 11 bits for a double-precision standard IEEE-754 float. ...
1
by: Wayne Shu | last post by:
Hei everyone: Just see the output of the following program #include <iostream> #include <cstdlib> #include <limits> int main() { std::cout << "minimum exponent of double: " <<
1
by: raj4ever188 | last post by:
Hi, I have a problem. I want to get output in terms of fixed exponent from sprintf. for example if i write sprintf(buf, "%.3e", ground_cap); I want the exponent part will be in terms of...
3
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, By default, the "g" format specifier seems to use 2 digits in the exponent if it decides to use the scientific format. I.e., Double.ToString("g"). How do I control the number of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.