DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

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 (permalink)  
Old April 29th, 2008, 03:59 PM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 165
Thanks: 32
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 (permalink)  
Old April 29th, 2008, 04:56 PM
Wolffy's Avatar
Slaprentice of Wolves


 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 150
Thanks: 1
Thanked 23 Times in 20 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 (permalink)  
Old April 29th, 2008, 10:32 PM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 165
Thanks: 32
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


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 12:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46