specs icon indicating copy to clipboard operation
specs copied to clipboard

Type to represent a currency

Open tredoe opened this issue 8 years ago • 3 comments

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

tredoe avatar Dec 22 '16 04:12 tredoe

Not sure if this currency pattern suggestion is of any help?

Stephen-Gates avatar Apr 28 '18 06:04 Stephen-Gates

We should not try to copy all of Open Document Spreadsheet Data Types. Could be made an extension instead.

nichtich avatar Jan 04 '24 09:01 nichtich