DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

format currency to display by thousands

This is a discussion on format currency to display by thousands within the ASP Development forums, part of the Programming & Scripting category; Hey All, I have a currency field in SQL 2000 - money(8) in my table with value ex: 117000 and ...

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

  #1  
Old April 29th, 2008, 03:59 PM
Rebelle's Avatar
Barn Loyal
 
Join Date: Mar 2008
Posts: 748
Rep Power: 2
Rebelle will become famous soon enough
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!
  #2  
Old April 29th, 2008, 04:56 PM
Wolffy's Avatar
Wolfmaster
 
Join Date: Mar 2008
Real name: Wolff
Location: Peoria, IL
Posts: 779
Blog Entries: 1
Rep Power: 9
Wolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to behold
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
Barn Loyal
 
Join Date: Mar 2008
Posts: 748
Rep Power: 2
Rebelle will become famous soon enough
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



All times are GMT -4. The time now is 11:17 PM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2