
Type: Improvement

Status: Closed

Priority: Major

Resolution: Fixed

Affects Version/s: V4.0_OS

Fix Version/s: V4.0_ERRATA03

Component/s: CSDL XML

Labels:None

Environment:
[Applied]

Proposal:
(Relates to ODATA771)
ODATA789 attempted to address a number of questions around the use of Edm.Decimal. Part of that was clarifying/correcting current semantics of Edm.Decimal, and was accepted at part of ODATA789. Part of the issue discussed the addition of an exponential notation, which was already the topic of ODATA771 and will be tracked there.
This issue tracks the remaining issue from ODATA789, the proposal to expand Edm.Decimal to support negative scale.
Decimal data types in programming languages and databases
===============================================
Common terminology is
Value = Mantissa * 10**(Scale)
Precision = length of Mantissa
Positive Scale means fractional digits, negative scale avoids representing "trailing zeroes" for large integers, e.g. one million has mantissa = 1, scale = 6
Type Precision = length of mantissa Scale = Exponent

C# decimal 96 bit ~ 2829 decimal digits Instance, 0...28
ObjectiveC NSDecimalNumber 38 decimal digits Instance, 128...127
Java BigDecimal unlimited no of decimal digits Instance, 2,147,483,648...2,147,483,647 (32 bit)
DECFLOAT34 34 decimal digits Instance, 384...383
DECFLOAT16 16 decimal digits Instance, 6144...6143
DB2 DECIMAL 1...31 decimal digits Column, 0...Precision
Sybase ASE DECIMAL 1...38 decimal digits Column, 0...Precision
Sybase IQ DECIMAL 1...126 decimal digits Column, 0...Precision
Postgres DECIMAL 1...1000 decimal digits Column, 0...Precision
Oracle NUMBER 1...38 decimal digits Column, 84...127
Problem when mapping NUMBER to Edm.Decimal
 Scale cannot be negative or larger than Precision