Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8460187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:32:11+00:00 2026-06-10T13:32:11+00:00

I have the following Column in my gridview <asp:BoundField ItemStyle-Font-Bold=true DataFormatString=£{0:C2} DataField=PriceBasePrice HeaderText=Price you

  • 0

I have the following Column in my gridview

<asp:BoundField ItemStyle-Font-Bold="true" 
            DataFormatString="£{0:C2}" DataField="PriceBasePrice"
            HeaderText="Price you pay" ItemStyle-Width="120" />

The value being passed to the Column is 180.0

I thought that with:

       DataFormatString="£{0:C2}"

The Value would return as £180.00

but it returns as £180.0

Does anyone know what DataFormatString I should use ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:32:13+00:00Added an answer on June 10, 2026 at 1:32 pm

    You may need to set the HtmlEncode attribute to false preventing the value being cast to a string first.

    Alternatively you could just specify you’re own format string:

    DataFormatString="£{0:###,###,###.00}"
    

    The # are empty until replaced with a value if one exists and the 0 are replaced with a value if one exists, otherwise they stay as 0.

    Se Custom Numeric Format Strings – http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following GridView <asp:GridView ID=grdImoveis runat=server DataSourceID=dsGrid> <Columns> <asp:BoundField HeaderText=Nome DataField=NomeCompleto />
In my GridView, I have the following columns: <Columns> <asp:BoundField DataField=report_type HeaderText=Report Type SortExpression=report_type
I have the following gridview: <asp:GridView ID=gdvReport runat=server AutoGenerateColumns=False DataSourceID=sdseport> <Columns> <asp:BoundField DataField=Phone HeaderText=Phone
I have the following code in the columns section of my GridView: <Columns> <asp:boundfield
I have the following GridView in ASP.NET 3.5: <asp:GridView ID=gvTable runat=server AllowSorting=true ShowHeader=true> <Columns>
i have the following gridview <asp:GridView ID=GridView3 runat=server AllowPaging=True AllowSorting=True AutoGenerateColumns=False DataKeyNames=ID DataSourceID=CommentsDataSource> <Columns>
I have the following GridView and ObjectDataSource: <asp:GridView ID=grdTrades runat=server DataSourceID=srcTrades DataKeyNames=tradeId EnablePersistedSelection=true SelectedRowStyle-BackColor=Yellow
<asp:GridView ID=grdCatgory runat=server AutoGenerateColumns=false> <Columns> <asp:BoundField DataField=Name HeaderText=Name /> <asp:BoundField DataField=Description HeaderText=Description /> <asp:TemplateField
The .aspx: <asp:GridView ID=gvFirst runat=server AutoGenerateColumns=false AllowPaging=true ondatabound=gvFirst_DataBound > <Columns> <asp:BoundField DataField=ID HeaderText=ProductID/> <asp:BoundField
If I have the following (generic) ASP code: <asp:ObjectDataSource runat=server ID=myODS>...</asp:ObjectDataSource> <asp:GridView runat=server ID=myGV

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.