Framework 1.0 Rounding Probelm

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QkIyMDY=?=

    Framework 1.0 Rounding Probelm

    How to do if I want to rounding like this :

    2 decimal point :

    12.445 = 12.45
    12.4449 = 12.44

    Just like the rounding result in SQL Server


  • Tom Shelton

    #2
    Re: Framework 1.0 Rounding Probelm

    On 2008-05-30, BB206 <BB206@discussi ons.microsoft.c omwrote:
    How to do if I want to rounding like this :
    >
    2 decimal point :
    >
    12.445 = 12.45
    12.4449 = 12.44
    >
    Just like the rounding result in SQL Server
    >
    >
    Math.Round... Though you depending on how you want to handle midpoints,
    you might or might not need to use one of the overloads that allows you
    to specify midpoint behavior.

    --
    Tom Shelton

    Comment

    • Michel Posseth  [MCP]

      #3
      Re: Framework 1.0 Rounding Probelm

      All IDE`s C# , VB , DELPHI etc etc etc and even COBOL use Bankers
      rounding as there standard
      in your situation you must use mathematical rounding midpoint rounding away
      from zero to be precise


      HTH

      Michel





      "Tom Shelton" <tom_shelton@YO UKNOWTHEDRILLco mcast.netschree f in bericht
      news:eVYuBWowIH A.1236@TK2MSFTN GP02.phx.gbl...
      On 2008-05-30, BB206 <BB206@discussi ons.microsoft.c omwrote:
      >How to do if I want to rounding like this :
      >>
      >2 decimal point :
      >>
      >12.445 = 12.45
      >12.4449 = 12.44
      >>
      >Just like the rounding result in SQL Server
      >>
      >>
      >
      Math.Round... Though you depending on how you want to handle midpoints,
      you might or might not need to use one of the overloads that allows you
      to specify midpoint behavior.
      >
      --
      Tom Shelton

      Comment

      Working...