Format Double Values using BoundColumn.DataFormatString

Discussion in 'ASP .Net Datagrid Control' started by Prasad Dannani, Jun 25, 2005.

  1. 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
    Prasad Dannani, Jun 25, 2005
    #1
    1. Advertising

  2. Prasad Dannani

    Elton Wang Guest

    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
    >
    >
    >
    Elton Wang, Jun 27, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    410
  2. Randall Parker
    Replies:
    1
    Views:
    6,136
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Dec 12, 2005
  3. Sydex
    Replies:
    12
    Views:
    6,472
    Victor Bazarov
    Feb 17, 2005
  4. mesut
    Replies:
    0
    Views:
    567
    mesut
    Jun 29, 2007
  5. Aaron

    DataFormatString on boundcolumn not working

    Aaron, Apr 15, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    288
    Michael Tkachev
    Apr 16, 2004
Loading...

Share This Page