Display 2 decimal places for amount in repeater control

I am displaying an amount value in my repeater control (<%#Eval ("totalamt")) and would like it to be formatted to 2 decimal places. The value from the database is 2 decimal, however, the repeater is displaying 4 decimal palces.

<asp:Label Font-Size="X-Small" ID="lblTotalAmt" runat="server" Text='<%#Eval ("totalamt") %>'></asp:Label>

How can I display this with 2 decimal places?

-------------Problems Reply------------

<asp:Label Font-Size="X-Small" ID="lblTotalAmt" runat="server" Text='<%#string.Format("{0:n2}",Eval("totalamt")) %>'></asp:Label>

Category:asp.net Views:1 Time:2011-10-20

Related post

  • Controlling ASP .Net repeater control output height 2009-07-09

    I'm currently implementing an RSS feeder control for a website. I'm planning to allow a limit of 10 items to be displayed on the homepage using a repeater control. My question is how do I prevent the height of the control exceeding a certain dimensio

  • Not able to display an image in repeater control for [thumbnail images] 2009-11-14

    hi i have imgae path in datatable[id, path] now this would a value like ex: id path 1 F:\R&D\RD\RD\Images\a1.JPG; 2 F:\R&D\RD\RD\Images\a2.JPG; 3 F:\R&D\RD\RD\Images\a3.JPG; now these images are in size width*height (1018*768). now i need

  • Display multiline in Repeater Control? 2011-07-26

    I am creating a Facebook Wall like structure and used repeater control for that using C#-Visual Studio 2010 amd Sql Server 2005 as database. I am unable to display multiline text in repeater control Script <asp:TextBox ID="TextBox1" runat="server"

  • How to Display/Hide Binded Field in Repeater Control eg. (if the field is null then hide) 2012-02-11

    i have a repeater control with some binded columns to it i want to display/hide specific columns conditionally... eg: if three columns in repeater control and if it is null then hide and if notnull show that field... Thanks in Advance...! -----------

  • Display List values using repeater control asp.net 2012-02-19

    I've added the content from DirectoryInfo.GetFiles() to a List<string>. Now I wish to display each row from the list using the Repeater control. I've done this before with the <%# Eval("Name") %> when I got the data directly from Director

  • ASP.NET - Callback Rebinding repeater control is not displaying latest information 2010-12-17

    I did re bind the Repeater control (with in Ajax popup extender) in a call back method, but not showing the latest information. Any way to re render the control manually? or any idea to get it done? Thanks ka

  • How to incrementally load an asp.net page having a Repeater control? 2011-06-15

    I have a page that shows results of a query. The results are displayed using a Repeater control that emits a div element that holds text data and images related to that particular result. The problem is that the page takes considerable amount of time

  • C#/.Net 2.0: Problem with the Repeater control and Checkboxes when inside a User Control! 2008-12-19

    I have a repeater control with a check box, if I check the box then my delete functionality will delete an item in the underlying table. When I test the delete functionality on an aspx page with a code behind page, everything works fine. Hooray! Howe

  • - inside a repeater control code not showing up in the source code on page render 2009-01-18

    I have a repeater control where the <%#DataBinder.Eval(Container.DataItem, "Display")%> part doesn't show up. The code that the "Display" stores is set as follows: item.Display = "<script type='text/javascript'>AudioPlayer.embed('ffcedea7

  • Nested Gridview in Repeater control 2009-03-09

    I have a gridview control nested within a repeater control. The repeater control is databound on pageload and in the itemdatabound event I look for the gridview control If e.Item.ItemType = ListItemType.Item Then Dim gvw As GridView = DirectCast(e.It

  • Refreshing a Repeater control in an UpdatePanel with ASP.NET 2009-07-14

    I'm trying to code a page where you can post a comment without reloading the whole page. The comments are displayed using a Repeater control. The template looks like this: <asp:UpdatePanel runat="server" ID="commentsUpdatePanel" UpdateMode="Condit

  • Creating a nested repeater control dynamically 2009-08-03

    I was wondering how we can create nested repeater control dynamically? I want to display Customers Sales Orders Quantity in a nested repeater control. Any help will be greatly appreciated. Thanks --------------Solutions------------- you can accomplis

  • how to bind an thumbnail image in repeater control 2009-11-13

    I have an requirement where in my datatable. I have 3 columns. serverpath,image name, id Now I need to get the imagepath from that the datatable[serverpath] and bind it in a repeater control or gridview control and show the thumbnail images there. Ac

  • Horizontal orientation in Repeater control 2009-11-13

    I have a Repeater control used to display uploaded images. How can I show the images in the repeater horizontally? How can i give the caption to the bottom of picture in this? --------------Solutions------------- assuming you have some code like this

  • Why not we use Repeater Control instead of Gridview Control? 2010-01-31

    I know GridView control comes with lot of built in functionality, which we can achieve from repeater control. GridView control has performance issues. Why don't we use repeater? You will be thinking why this question, if you can achieve the functiona

  • How can I access the group of a linq group-by query from a nested repeater control? 2010-03-26

    I'm using a linq group by query (with two grouping parameters) and would like to use the resulting data in a nested repeater. var dateGroups = from row in data.AsEnumerable() group row by new { StartDate = row["StartDate"], EndDate = row["EndDate"] }

  • displaying decimal values from database in textbox 2010-04-29

    i just want to ask how to set the textbox so it will display decimal numbers. Couse now if i read a decimal number from my access database like 0,2 it displays only 0 Tnx for the help! --------------Solutions------------- Check the format options on

  • Problem regarding displaying decimal values in C Program 2010-08-11

    the data-type 'float' displays decimal numbers. by default my compiler displays up-to 6 decimals. i want to see only two decimals. for eg , when the compiler performs the operation "c=2/3" it displays "0.666666667". i want to see only "0.67" in my ou

  • ASP.NET Repeater Control linking to detailed view via QueryString parameters 2010-08-19

    I have a Repeater Control using an XMLDataSource to produce a list of movies (Movies.aspx). I need to link to a detailed page via query parameters like MovieDetails.aspx?movie=Matrix. What control do I use on the MovieDetails.aspx page to render a si

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.162 (s). 11 q(s)