Restrict number of decimals to be displayed from DB
<p>I am fetching some values from my DB. The columns are of float type and are being displaed in DataList in the following manner. </p>

<pre><code>&lt;ItemTemplate&gt;
    &lt;tr&gt;
    &lt;td style="width:200px;text-align:left"&gt; Item1: &lt;%#Eval("Item1") %&gt;  |  Item2: &lt;%#Eval("Item2") %&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/ItemTemplate&gt;
</code></pre>

<p>I have to restrict the number of decimal values being displayed int he data list to 3. How can I do that here?</p>

<p>In the code-behind, the data is being fetched into the DataTable as follows.</p>

<pre><code>SqlDataAdapter adp = new SqlDataAdapter("Retrieve", ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
             DataSet ds = new DataSet();
             adp.SelectCommand.CommandType = CommandType.StoredProcedure;
             adp.SelectCommand.Parameters.Add("@s1", SqlDbType.NVarChar, 255).Value = strategies;
             adp.SelectCommand.Parameters.Add("@s2", SqlDbType.NVarChar, 255).Value = DropDownList1.SelectedItem.ToString();
             adp.Fill(ds);
             DataList1.DataSource = ds;
             DataList1.DataBind();
</code></pre>
