Rounding issue in TBCDField

From: Stephan St-Denis (stephans_at_progicielsconcept.com)
Date: 12/02/03


Date: Tue, 2 Dec 2003 11:56:56 -0500

Hi,

I'm facing a problem with a rounding issue that I don't know how to fix.

I have a variable (Currency type) that holds a value of 68.135. When I
assign this value to a TBCDField with Size = 2 (number of decimals after dec
point), the field contains 68.14.

I always thought that if a number ends with a 5 an the next digit was either
a zero or missing, the value would be rounded without adding .01 thus giving
68.13 and not 68.14.

What should I do to get the right result ? Maybe am I wrong and the correct
result should be 68.14 ?

Thanks,

Stephan



Relevant Pages

  • Re: Rounding issue in TBCDField
    ... > I'm facing a problem with a rounding issue that I don't know how to fix. ...
    (borland.public.delphi.language.objectpascal)
  • Re: Open Access Competition For FGW
    ... facing a decade when it will only get worse. ... That is a vast over-generalisation. ... On the Cotswold Line, we've gone from a situation where 15% of services ... If First wanted to fix it, First could have included proposals to ...
    (uk.railway)
  • Re: VB Rounding / RoundUp?
    ... CLng uses banker's rounding, which is what the OP wanted to avoid I believe, ... >> that what the Int and Fix functions already do? ...
    (microsoft.public.vb.general.discussion)
  • Re: ASP.NET 2.0-generated Javascript
    ... assuming you are running dotNet 2.0 ... open cmd prompt and type ... that should fix it ... Actually I am facing this problem whenever I click on a button and whenever I entered a text in a text box. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Rounding in the .Net Compact framework
    ... the .Net Compact framework. ... rounding method in place is "MidpointRounding.ToEven ". ... We have concluded that the compact version of the framework appears ... a certain urgency and if there already is a fix available, ...
    (microsoft.public.dotnet.framework.compactframework)