Jose
Mon Feb 23 05:47:51 CST 2004
Use either .ToString("#.00")
or .ToString("#,###.00") if you want thousands separators
"ruca" <ruuca@iol.pt> escribió en el mensaje
news:eJoSl%2399DHA.2404@TK2MSFTNGP12.phx.gbl...
> <%# (((int)DataBinder.Eval(Container,"DataItem.Qty"))*100).ToString("d9")
%>
>
> The part of ToString("d9") doesn't work.
> I have to set this value: DataBinder.Eval(Container,"DataItem.Qty"))*100)
> into a double of 2 decimal places
>
> How?
>
>
>
> "Jose Marcenaro" <josem@nospam.da-vinci.com.ar> escreveu na mensagem
> news:OPyeef99DHA.1312@TK2MSFTNGP09.phx.gbl...
> > 1. In the grid's Property Builder page, clear the "Data Format" field
and
> > then convert your "bound column" into a "templated column" using the
> > provided link
> >
> > 2. Edit the HTML and replace the binding expression as follows (assuming
> > DataItem.Qty is an integer)
> >
> > Instead of
> > <%# DataBinder.Eval(Container, "DataItem.Qty") %>
> > use
> > <%# (((int)DataBinder.Eval(Container,
> > "DataItem.Qty"))*100).ToString("d9") %>
> >
> > Regards
> > Jose.
> >
> > "ruca" <ruuca@iol.pt> escribió en el mensaje
> > news:O8gyMn89DHA.1312@TK2MSFTNGP09.phx.gbl...
> > > How can I format a Field that I have to calculate something.
> > > Like this:
> > > Field1 in DB is a Double
> > > Field1 = 0.11
> > >
> > > And I want to appear: 0.11 * 100 = 11
> > >
> > >
> > > Thanks
> > >
> > > "Martin Dechev" <detcheff_@hotmail.com> escreveu na mensagem
> > > news:Op8$cc79DHA.2404@TK2MSFTNGP11.phx.gbl...
> > > > Hi, ruca,
> > > >
> > > > You can achive this by setting the DataFormatString property of the
> > > > BoundColumn approprietly:
> > > >
> > > >
> > >
> >
>
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwebuiwebcontro
> > > lsboundcolumnclassdataformatstringtopic.asp
> > > >
> > > > Set it to "dd-MM-yyyy". See the following link for more valid custom
> > > > DateTime format strings:
> > > >
> > > >
> > >
> >
>
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomdatetimeform
> > > atstrings.asp
> > > >
> > > > Greetings
> > > > Martin
> > > > "ruca" <ruuca@iol.pt> wrote in message
> > > > news:eoMY1G79DHA.4020@TK2MSFTNGP09.phx.gbl...
> > > > > Hi
> > > > >
> > > > > I want to format some columns of my DataGrid control.
> > > > > Example, one of my fields of DataSet is a DATE field and in BD he
is
> > Ok,
> > > > but
> > > > > when I show him in datagrid he comes with hours too. I don´t want
> > that.
> > > > >
> > > > > 2nd Example:
> > > > > Field in BD:
> > > > > DtSegm
> > > > > 17-02-2004
> > > > > Note: When I save to DB I format Date to put like above
> > > > >
> > > > > In DataGrid shows like this:
> > > > > DtSegm
> > > > > 17-02-2004 10:30:45
> > > > >
> > > > > How can I change that.
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > Thank's (if you try to help me)
> > > > > Hope this help you (if I try to help you)
> > > > > ruca
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>