473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Format DataItem as Currency and NO decimals

Quick question -

I have output from a Money MS SQL field going into a repeater's dataitem.
The db does not store any cents (decimals). How can I get this on the page:

<%#DataBinder.Eval(Container.DataItem, "Revenue", "{0:C}")%>

...NOT to display any decimals or cents?


Mar 20 '06 #1
1 2694
Rather than try to convert the value to Currency, simply prepend it with a $
like the following:

<%#DataBinder.Eval(Container.DataItem, "Revenue", "${0}")%>

If you would like, you can specify that an integer format be used (such as
"${0:D}"). For more information, see

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconstandardnumericformatstrings.htm

Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"D. Shane Fowlkes" <sh**********@h-o-t-m-a-i-l.com> wrote in message
news:e4**************@TK2MSFTNGP14.phx.gbl...
Quick question -

I have output from a Money MS SQL field going into a repeater's dataitem.
The db does not store any cents (decimals). How can I get this on the
page:

<%#DataBinder.Eval(Container.DataItem, "Revenue", "{0:C}")%>

..NOT to display any decimals or cents?



Mar 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hung Huynh | last post by:
Is there an easy way to change Currency formatting from USD to EUR (use comma as decimals delimiter instead of period)? I'm using Windows 2000 Server/IIS 5.0 in English. I'm serving both USD and...
2
by: DD | last post by:
I have a UnionQry that is run from StatementsI and StatementP. the Due and Paid colunms are currency and show the $ however when i union the two the currency format has gone. Any help please...
1
by: Julius Fenata | last post by:
Dear all, I need help to change my item-template value format... Here is my case, I have a datagrid, with 'SubjectPrice' field, and when the grid displayed, my 'SubjectPrice' field displayed...
1
by: D. Shane Fowlkes | last post by:
I have a DataItem in a Template that calls a Function to perform a calculation. The Function returns a decimal value. Easy enough. It looks like this: <code> <%#...
2
by: VB Programmer | last post by:
I have a datalist that contains a label for each time to hold pricing info. In the Access db everything is stored in a currency format. But, when the label displays the info it's not in currency...
1
by: Dave Wurtz | last post by:
All, I have a NumberFormatInfo object with specific setting (i.e. number of decimals, thousands separator, decimal separator, currency symbols, etc.) based upon my application, not my system's...
6
by: Mitchell Vincent | last post by:
Just making sure I'm not missing the boat here, but are there any special routines for doing currency math (fixed precision stuff) in .NET? The wonderful problems of doing math on decimals tend...
3
by: JeffP | last post by:
In the datagrid I have $320.00 from... <asp:Label ... Text='<%# DataBinder.Eval(Container, "DataItem.Install_1", "{0:c}") %>' ...> How can I get: $320
2
by: crferguson | last post by:
Hello all! I'm having the oddest issue trying to format a numeric string as currency without decimals. For instance... strSalary = "120000.56" strSalary = Format(strSalary, "$#,##0") 'this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.