Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Removing digits from values

Posted 10 Apr 2004 08:24:07
1
has voted
10 Apr 2004 08:24:07 Charles Beaudry posted:
I've got a situation where I have data values for various years. For example, I have:

2004: 134,759,265.24
2003: 112,592,453.89
2002: 98,678,264.09

I want to be able to display these numbers in trillions only so that the page would display:

2004: 134,759
2003: 112,592
2002: 98,678

Obviously the left() function cannot work here since there are a different number of digits in 2002.

What function could I use that would eliminate the extra digits so that the data would be displayed properly?

Thanks for any help.

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

Replies

Replied 10 Apr 2004 19:49:13
10 Apr 2004 19:49:13 Phil Shevlin replied:
Its just math - really...

formatnumber(int("134,759,265.24" / 1000),0)

Will return 134,759
Replied 10 Apr 2004 22:54:22
10 Apr 2004 22:54:22 Charles Beaudry replied:
That was so simple, it was ridiculous. I think my brain is getting too fried with this site... <img src=../images/dmxzone/forum/icon_smile_dead.gif border=0 align=middle>

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Its just math - really...

formatnumber(int("134,759,265.24" / 1000),0)

Will return 134,759
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Edited by - cbeaudry on 10 Apr 2004 22:54:43

Reply to this topic