specs
specs copied to clipboard
Type to represent a currency
A currency is a special type which can not be represented with a floating-point literal since you require exact storage and calculations. i.e. in PostgreSQL you have the type numeric to store them. To store such types, you usually use two integers, one for the integer part, and other one for the decimal part.
By that reason, I suggest to create a new type so people don't get confused by relating a numeric type of decimal representation with a currency.
Also, for the lexical representation, could be used the code alpha (like "USD" to USA dollar) followed of the decimal representation.
USD 1.2
EUR 5.98
http://www.currency-iso.org/en/home/tables.html
Not sure if this currency pattern suggestion is of any help?
We should not try to copy all of Open Document Spreadsheet Data Types. Could be made an extension instead.