Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "format currency to display by thousands" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Closed Thread « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old April 29th, 2008, 03:59 PM
Rebelle's Avatar
V.I.P/Donor


 
Join Date: Mar 2008
Posts: 254
Thanks: 48
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default format currency to display by thousands

Hey All,

I have a currency field in SQL 2000 - money(8) in my table with value ex: 117000 and in ASP, I have the following:

Code:
<TD bgcolor="#E0FFFF" align=center><%=formatcurrency(rs("ItemCost"),0)%></TD>
It displays as $117,000 on the web view, but I don't want it to show this, I want it to show $117 only.

Is this possible?

Thanks!
Sponsored Links
  #2  
Old April 29th, 2008, 04:56 PM
Wolffy's Avatar
Slaprentice of Wolves

 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 175
Thanks: 3
Thanked 24 Times in 21 Posts
Rep Power: 1
Wolffy is on a distinguished road

Awards Showcase
Microsoft .Net 
Total Awards: 1

Default

Divide it by 1000 first and take the integer of the result.

Comments on this post
mehere agrees: that's the way to go
Rebelle agrees: Thank you very much!
jmurrayhead agrees: nice work, wolfman
The Following 2 Users Say Thank You to Wolffy For This Useful Post:
jmurrayhead (May 27th, 2008), Rebelle (June 17th, 2008)
  #3  
Old April 29th, 2008, 10:32 PM
Rebelle's Avatar
V.I.P/Donor


 
Join Date: Mar 2008
Posts: 254
Thanks: 48
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

Thanks Wolffy!
Here is what I did and it looks good, like $117.

Code:
<%
intItemCost = rs("ItemCost")
intItem = FormatCurrency((intItemCost / 1000),0)
%>
Code:
<TD bgcolor="#E0FFFF" align=center><%= intItem %></TD>
Thanks so much!!!
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -4. The time now is 06:51 PM.



Content Relevant URLs by vBSEO 3.2.0