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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

length limitation when printing to screen?

Status
Not open for further replies.

Ovatvvon

Programmer
Feb 1, 2001
1,514
US
I asked this in the classic ASP forum, but no one has been responding, and I think this could apply to both ASP and ASP.NET, so I'll ask here as well...

I have a mathmatical formula done in DLL and returned to the original calling page which in turn prints the value to the screen. However, the problem is that the number is so big it returns the number with an "E" extension like this:

2.64443852120454E+47


How can I tell it to print out the entire number with out the E+47?

So it will look something like this:

264443852120454455213225875701055682498700013529


-Ovatvvon :-Q
 
How about returning it as a string (especially if its only used for display purposes)?

In your DLl, instead of returning an integer, return the string

i.e.

strString = CStr(math function)

Havn't tested it, so I'm not sure if it adds the E stuff in before it would assign to the string value, or if that would happen after. Either way its worth a test.

D'Arcy
 
I tried that, but it didn't work....Here's a pretty close sample of what I have just to give you an idea...

____________________________


<% @ Language='vbscript' %>
<% Option Explicit %>

<BR>
<form action='matrix.asp' method='post'>
Enter a value such as 112 or 250.
<TEXTAREA name='data' cols=30 rows=3></TEXTAREA>
<input type='submit' value='Process Value'>
</form>
<BR><BR><BR>
<HR>

<%

If Request.Form(&quot;data&quot;) <> &quot;&quot; Then
Response.write(&quot;<BR> <TEXTAREA cols=40 rows=13>&quot; & mathPower(Request.Form(&quot;data&quot;), 9) & &quot;</TEXTAREA> <BR><BR>&quot;)

End If




Public Function mathPower(pintInputValue, pintPowerLevel)
Dim i
Dim pintCurrentValue

pintCurrentValue = 1 'So multiplying by zero won't affect calculations.

For i = 1 To pintPowerLevel Step 1
pintCurrentValue = pintInputValue * pintCurrentValue
Next

mathPower = CStr(pintCurrentValue)
End Function

%>

____________________________

When you enter a high enough number like 140 or something like that in the web form textarea, you'll see what I mean. Hopefully someone knows how to disable this feature.
-Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top