TBD54566975 / tbdex

56 stars 25 forks source link

Clarify what the possible values are for "amount" #203

Open andresuribe87 opened 9 months ago

andresuribe87 commented 9 months ago

Many fields use a data type of string to represent numbers. The description of the fields mention an "amount". Some examples include:

It would be helpful to clarify what possible values are for those fields. One proposal below.

Define a data type that is Decimal. The data type Decimal is serialized as a string. The only possible values of a string such that it would be correctly deserialized would be values that match the regex /^\d*\.?\d*$/ (or similar).

diehuxx commented 9 months ago

Possible duplicate of https://github.com/TBD54566975/tbdex/issues/199, which includes discussion of other aspects of currency representation as well.

phoebe-lew commented 9 months ago

Add to spec: use 3 digits beyond the currency's significant digits for amount representation.

mistermoe commented 9 months ago

notes from tbdex office hours:

seems like everyone is on board. can add a decimal definition in the definitions.json json schema and use that as a $ref for all amount values