Skip to content

Decimal type? #121

@codalogic

Description

@codalogic

Decimal would be a nice type to have, as often protocols don't want to have to deal with something like: 1e+0.

The problem is that it would be nice to be able to specify the number of decimal places, AND the range, without conflicting with the short float definitions.

Copying the idea for our int? types, for an example price type, defined as a decimal with 2 decimal places, and that must be positive, one possibility is:

"price" : decimal.2  0.0..,

The ABNF might look like:

decimal-type = decimal-kw [ decimal-places ] [ spaces float-range ]
decimal-places = "." pos-integer

We could possibly add this as an experimental type in an appendix of the I-D if we're not comfortable with it yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions