cqframework/cql-execution

Improve support for CQL Decimal

Opened this issue · 0 comments

The CQL Decimal type supports "decimal values in the range (-10^28 + 1)/10^8 to (10^28-1)/10^-8 with a step size of 10^-8." CQL Execution supports CQL Decimal using JavaScript Number. This implementation has a few limitations regarding the CQL specification:

  • Precision is lost at the upper and lower ends of the required range of numbers
  • Initial precision is not maintained in all cases (e.g., there is no discernible difference between 1, 1.0, and 1.00)
  • Type is not maintained for non-fractional numbers (e.g., unable to determine if 1.0 should be an integer, long, or decimal) (#204)

The approach for supporting CQL Decimal should be the same (or similar) as for supporting CQL Long (#207).