Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Rounding rule used in Forms for decimal values

Meghan A-OracleAug 11 2014 — edited Aug 11 2014

I'm trying to determine what tie-breaking rounding rule Forms uses to round decimal numbers fetched from the database for display in a shorter-length field. Specifically, when a number is equidistant from its neighbors (e.g. 0.5 is equidistant from 0 and 1), what rule is used to determine whether it's rounded up or down (see this for a reference on standard rounding rules)? The online help documentation addresses rounding, but does not specify which rounding rule is used (e.g. half away from zero, half even or "Banker's rounding", etc).

I tried to figure this out by trial and error, but am getting inconsistent results. Here are my test cases...

For both test cases:

Database field is NUMBER(20,4)

Form field is of type Number, length 30

Form field format mask, set programmatically, is FM999G999G999G999G999G999G999G999G999G999G999G990D90PR (that is, round to 2 decimal places)

The Form field displays the value of the database field directly

Test 1:

Database field value is 1.4445

Result: The field in the form displays the value as 1.44

Test 2:

Database field value is 1.445

Result: The field in the form displays the value as 1.45

This is totally inconsistent. If "half away from zero" or "half to odd" rounding were used, then the Test 1 value should be displayed as 1.45 (because the last 5 will round the previous 4 up to 5, and repeat). On the other hand, if "half to zero" or "half to even" rounding were used, the Test 2 value should be displayed as 1.44.

I understand that the stored values in the form are not rounded, and that this will not necessarily result in calculation errors. However, it is necessary for documentation purposes that I determine what is the actual rule used for displaying rounded values.

I am using Forms 11gR2.

This post has been answered by Meghan A-Oracle on Aug 11 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 8 2014
Added on Aug 11 2014
1 comment
1,821 views