fixed point decimal

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christel

    #1

    fixed point decimal

    I am doing calculations on numbers and then I want to display them in a datagrid that always has 2 decimal places. I am doing something like

    Dim Size As Decimal
    Dim Space As Decimal
    ...
    ...
    ...
    Size = Decimal.Round(S ize, 2)
    Space = Decimal.Round(S pace, 2)

    If the number happens to round to say 95 I want it to display as 95.00. How can I do that?

    Thanks in advance.
    Christel
  • Miha Markic

    #2
    Re: fixed point decimal

    Hi Christel,

    Take a look at Binding.Format Event.

    --
    Miha Markic - RightHand .NET consulting & development
    miha at rthand com


    "Christel" <anonymous@disc ussions.microso ft.com> wrote in message
    news:9B4A45F9-D8C6-4E5D-BC6B-0302589B9A3B@mi crosoft.com...[color=blue]
    > I am doing calculations on numbers and then I want to display them in a[/color]
    datagrid that always has 2 decimal places. I am doing something like[color=blue]
    >
    > Dim Size As Decimal
    > Dim Space As Decimal
    > .
    > .
    > .
    > Size = Decimal.Round(S ize, 2)
    > Space = Decimal.Round(S pace, 2)
    >
    > If the number happens to round to say 95 I want it to display as 95.00.[/color]
    How can I do that?[color=blue]
    >
    > Thanks in advance.
    > Christel[/color]


    Comment

    Working...