Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Removing Exponentials

Posted 29 Apr 2004 08:10:22
1
has voted
29 Apr 2004 08:10:22 Charles Beaudry posted:
I'm building an economic siyte that compares currency values from all over the world. These are stored in a database table. Right now the site does comparisons between three countries (US, Canada and Mexico) to the country selected. Things are working well right now.

However, the client now wants to move this to the next level which is to let the user select the three countries a currency will be compared to. Generally, there is no problem. However, certain countries (ex. Turkey) have such a low value that any data displayed has an exponential on it such as 2.337645E05

How do I ensure that the exponential is not diaplayed without creating an overflow? I need it to display 0.00002337645 instead of 2.337645E05 because the next formula on the page is calculating the percent increase over the last value.

I have tried clng, cstr, abs but none of them seem to work.

Any suggestions?

Edited by - cbeaudry on 29 Apr 2004 08:10:48

Replies

Replied 30 Apr 2004 02:19:44
30 Apr 2004 02:19:44 Phil Shevlin replied:
I see what you're wanting to do. But if you allow for such precision, will it cause you a problem if the value is greater than 1 and shows 35.921235879?

Because you can change the datatype of the field to float.
Replied 30 Apr 2004 02:55:57
30 Apr 2004 02:55:57 Charles Beaudry replied:
I need the precision because because it's precise currency values we're providing, down to 8 decimals.
Replied 30 Apr 2004 03:19:41
30 Apr 2004 03:19:41 Phil Shevlin replied:
Well then, can you change it to float?
Replied 30 Apr 2004 03:44:39
30 Apr 2004 03:44:39 Charles Beaudry replied:
Is that a database function in Access or can that be done in ASP? I've never worked with a floating point series of data before.
Replied 30 Apr 2004 03:56:21
30 Apr 2004 03:56:21 Phil Shevlin replied:
Thought you were working with SQL. I think Numeric will allow precision up to what you need. Just change the datatype to Numeric (after a backup<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>.

Reply to this topic