Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Format Double Values using BoundColumn.DataFormatString

Reply
Thread Tools

Format Double Values using BoundColumn.DataFormatString

 
 
Prasad Dannani
Guest
Posts: n/a
 
      06-25-2005
Hi,

I have a Double Value. i am planning to display it in "0.0000" format i.e.
the decimals length is fixed i.e. 4.

I am using math.round function which is reducing the length to 4. but if the
length is just 2 digits then it is giving 2 digits only. where i want 4
digits.

Can anyone help me out. I done this functionality in visual basic but now i
want it for c#.net

Thanks in advance
Prasad Dannani



 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      06-27-2005
Hi Prasad Dannani,

You can use DataFormatString="{0: ####0.0000}" in BoundColunm to format
output to 4 decimals.

HTH

Elton Wang


"Prasad Dannani" <> wrote in message
news:%...
> Hi,
>
> I have a Double Value. i am planning to display it in "0.0000" format i.e.
> the decimals length is fixed i.e. 4.
>
> I am using math.round function which is reducing the length to 4. but if

the
> length is just 2 digits then it is giving 2 digits only. where i want 4
> digits.
>
> Can anyone help me out. I done this functionality in visual basic but now

i
> want it for c#.net
>
> Thanks in advance
> Prasad Dannani
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
from List <double> to double[] Web learner ASP .Net 3 04-26-2006 05:26 PM
Should I be concerned about buying DVD18s (Double-sided, double-layered) The Man With No Name DVD Video 3 02-04-2006 01:45 AM
cannot convert parameter from 'double (double)' to 'double (__cdecl *)(double)' error Sydex C++ 12 02-17-2005 06:30 PM
Double double display display problem problem Tom Accuosti Firefox 3 09-27-2004 10:02 PM
structs of double as double[] sb C++ 4 02-19-2004 07:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57