Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
RTL
Delphi
Arithmetic
ConvUtils
Date - Time
DateUtils
File Management
Format + Float
Input/Output
Math Unit
Memory, Pointer, Address
Null-terminated strings
Other Classes
Other RTL
Pascal Strings
Regular Expressions
RTL Exceptions
Text Files
Thread support
Typed/Untyped Files
WinAPI
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/RTL/Delphi/Other RTL
[ Add a report in this area ]
Report #:
105408
Status:
Open
BcdRoundTo and RoundAt return different result
Project:
Delphi
Build #:
16.0.4429.46931
Version:
16.4
Submitted By:
Chee Yang Chau
Report Type:
Basic functionality failure
Date Reported:
5/7/2012 1:29:35 AM
Severity:
Serious / Highly visible problem
Last Updated:
5/16/2012 11:59:10 PM
Platform:
All platforms
Internal Tracking #:
28253
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
In Delphi XE2, the RoundAt function in FmtBcd.pas has marked deprecated:
function RoundAt(const Value: string; Position: SmallInt): string; deprecated 'use BcdRoundTo';
However, some cases fail when replace the RoundAt to BcdRoundTo.
BcdRoundTo seems using Banker rounding but RoundAt is using classic rounding (similar to SimpleRoundTo).
Steps to Reproduce:
Run the following code in Delphi XE2:
-----------
var
B: TBcd;
S: string;
begin
S := '109.885';
B := BcdRoundTo(StrToBcd(S), -2);
WriteLn('BcdRoundTo: ', BcdToStr(B));
WriteLn('RoundAt: ', RoundAt(S, 2));
Readln;
end.
-----------
The output is:
BcdRoundTo: 109.88
RoundAt: 109.89
Workarounds
None
Attachment
None
Comments
Tomohiro Takahashi at 5/17/2012 7:26:54 PM
-
This report was opened with valid Internal Tracking Number.
Thanks.
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us