I have a databind in a repeater control
<%#Eval("Score")%>
Score is a float
float Score = 3.2;
However the html output is always 3 I cannot make it display 3.2.
PLease help,
Howard 5 2693
Try this:
<%#Eval("Score").ToString("n")%>
If you need to specify how many decimal places to use, do the following (the
following will use 10 decimal places, adjust this to your preference):
<%#Eval("Score").ToString("n10")%>
If you have any questions, feel free to ask. You can also see Visual
Studio's section on "Format Specifiers" for more detail. Good Luck!
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message
news:e1**************@TK2MSFTNGP02.phx.gbl... I have a databind in a repeater control <%#Eval("Score")%>
Score is a float float Score = 3.2; However the html output is always 3 I cannot make it display 3.2.
PLease help, Howard
I tried that it says
No overload for method 'ToString' takes '1' arguments
object.ToString()
There has to be a way to display decimals.
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:OM**************@TK2MSFTNGP04.phx.gbl... Try this:
<%#Eval("Score").ToString("n")%>
If you need to specify how many decimal places to use, do the following (the following will use 10 decimal places, adjust this to your preference):
<%#Eval("Score").ToString("n10")%>
If you have any questions, feel free to ask. You can also see Visual Studio's section on "Format Specifiers" for more detail. Good Luck! -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message news:e1**************@TK2MSFTNGP02.phx.gbl...I have a databind in a repeater control <%#Eval("Score")%>
Score is a float float Score = 3.2; However the html output is always 3 I cannot make it display 3.2.
PLease help, Howard
Try this (my suggestion is not really the one I would have used, but it
looked like the one you would have preferred, but I admit I didn't actually
try that one):
<%# DataBinder.Eval(Container, "DataItem.Score","{0:n}") %>
or to specify the number of decimals:
<%# DataBinder.Eval(Container, "DataItem.Score","{0:n10}") %>
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl... I tried that it says No overload for method 'ToString' takes '1' arguments
object.ToString()
There has to be a way to display decimals.
"Nathan Sokalski" <nj********@hotmail.com> wrote in message news:OM**************@TK2MSFTNGP04.phx.gbl... Try this:
<%#Eval("Score").ToString("n")%>
If you need to specify how many decimal places to use, do the following (the following will use 10 decimal places, adjust this to your preference):
<%#Eval("Score").ToString("n10")%>
If you have any questions, feel free to ask. You can also see Visual Studio's section on "Format Specifiers" for more detail. Good Luck! -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message news:e1**************@TK2MSFTNGP02.phx.gbl...I have a databind in a repeater control <%#Eval("Score")%>
Score is a float float Score = 3.2; However the html output is always 3 I cannot make it display 3.2.
PLease help, Howard
Thanks it works now
What is the difference between
Eval()?
and
DataBinder.Eval()?
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:Ob**************@TK2MSFTNGP03.phx.gbl... Try this (my suggestion is not really the one I would have used, but it looked like the one you would have preferred, but I admit I didn't actually try that one):
<%# DataBinder.Eval(Container, "DataItem.Score","{0:n}") %>
or to specify the number of decimals:
<%# DataBinder.Eval(Container, "DataItem.Score","{0:n10}") %> -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...I tried that it says No overload for method 'ToString' takes '1' arguments
object.ToString()
There has to be a way to display decimals.
"Nathan Sokalski" <nj********@hotmail.com> wrote in message news:OM**************@TK2MSFTNGP04.phx.gbl... Try this:
<%#Eval("Score").ToString("n")%>
If you need to specify how many decimal places to use, do the following (the following will use 10 decimal places, adjust this to your preference):
<%#Eval("Score").ToString("n10")%>
If you have any questions, feel free to ask. You can also see Visual Studio's section on "Format Specifiers" for more detail. Good Luck! -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message news:e1**************@TK2MSFTNGP02.phx.gbl... I have a databind in a repeater control <%#Eval("Score")%>
Score is a float float Score = 3.2; However the html output is always 3 I cannot make it display 3.2.
PLease help, Howard
I'm not sure there is a difference in this case, but in some cases they are
methods with the same name from different classes. I have been taught to use
DataBinder just to be safe, but if you prefer you can probably use just
Eval(). For more detail, see the documentation.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message
news:On**************@TK2MSFTNGP02.phx.gbl... Thanks it works now
What is the difference between Eval()? and DataBinder.Eval()?
"Nathan Sokalski" <nj********@hotmail.com> wrote in message news:Ob**************@TK2MSFTNGP03.phx.gbl... Try this (my suggestion is not really the one I would have used, but it looked like the one you would have preferred, but I admit I didn't actually try that one):
<%# DataBinder.Eval(Container, "DataItem.Score","{0:n}") %>
or to specify the number of decimals:
<%# DataBinder.Eval(Container, "DataItem.Score","{0:n10}") %> -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...I tried that it says No overload for method 'ToString' takes '1' arguments
object.ToString()
There has to be a way to display decimals.
"Nathan Sokalski" <nj********@hotmail.com> wrote in message news:OM**************@TK2MSFTNGP04.phx.gbl... Try this:
<%#Eval("Score").ToString("n")%>
If you need to specify how many decimal places to use, do the following (the following will use 10 decimal places, adjust this to your preference):
<%#Eval("Score").ToString("n10")%>
If you have any questions, feel free to ask. You can also see Visual Studio's section on "Format Specifiers" for more detail. Good Luck! -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Howard" <ho*******@yahoo.com> wrote in message news:e1**************@TK2MSFTNGP02.phx.gbl... >I have a databind in a repeater control > <%#Eval("Score")%> > > Score is a float > float Score = 3.2; > However the html output is always 3 I cannot make it display 3.2. > > PLease help, > Howard >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mat |
last post by:
<div id="container">
<div id="main">
<div id="header">
<p class="Address">123 Fake Street, </p>
<p class="City">Crazy City, </p>
<p class="Province">Ontario </p>
<p class="PostalCode">H0H...
|
by: fleemo17 |
last post by:
For increased accessibility, I've replaced "display:none" with the
Off-Left method of hiding my CSS drop-down menus because the Jaws
screen reader doesn't see any of the menus hidden with...
|
by: ruby_bestcoder |
last post by:
Hi
Im having problem in firefox with display:none/block.
I have essentially 3 li elements. In each element there are a few
nested div:s. Clicking on one of the divs, makes another div to...
|
by: Jannette |
last post by:
I've got this to finally work in IE (its only taken me 2 days solid), but now mozilla isn't displaying the text on the same line as the image. I'm a newby at CSS, and I've think I've worked on trying...
|
by: fishwick |
last post by:
I haven't really done any css in quite a while, and am banging my head
against the wall trying get the rudimentary layout together of a church
website home page to display correctly - I don't want...
|
by: camphor |
last post by:
hi,
if you go to www.christinebec.com/About CB/selected_editorials to view the images, I tested it out in Firefox and it displays properly but in IE7 the larger images overlap and don't display...
|
by: Sjef Janssen |
last post by:
I try to get a tabbed display work both in IE (6 and 7) and Firefox. The
last does give a problem. What's going wrong here? I'm totally puzzled.
<!doctype html PUBLIC "-//W3C//DTD XHTML 1.0...
|
by: Steve Richter |
last post by:
I would like to use display:inline and other CSS attributes to build
an entry form. Where the heading to the left of the text box is always
a set width.
It is not working so I am experimenting...
|
by: wreed06 |
last post by:
Hello,
I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
|
by: removeps-groups |
last post by:
Now I'm wondering how to display 3 elements next to each other. I
came up with the following solution using float:left, but would like
opinions if this is the right way to go.
The idea is to...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |