Format DataItem as Currency and NO decimals

  • Thread starter Thread starter D. Shane Fowlkes
  • Start date Start date
D

D. Shane Fowlkes

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?
 
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top