Forum Moderators: open

Message Too Old, No Replies

seting a 4 decimal figure on dynamic data in c#?

         

esbee

7:02 am on Sep 26, 2003 (gmt 0)



Hi all,

I would be the happiest man, if someone could let me know how to convert dynamic data in a 4 decimal figure, here's the code:

<td width="52%"><font color="#000066" size="2"face="Verdana, Arial, Helvetica, sansserif"><strong>Total accumulated pips</strong></font></td>
<td> <div align="right"><font color="#000066" size="2" face="Verdana, Arial, Helvetica, sans-serif">

//The following should be with 4 decimals

<%# Double.Parse(rsYearly1.FieldValue("tblPLPipsTotal", Container)) %>
</font></div></td>
</tr>

Thx in advance for your help.

plumsauce

6:44 pm on Sep 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




convert nn.nnnn to a string
add '0000' to the right as in
'nn.nnnn0000'

find the '.' advance four characters
to the right, then truncate your string
at that point.

or do step one, and a regular expression
to extract the result.