Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the type for currency?

I can't find a sample of currency data type in the object definition, nor a document on the subject.

like image 410
vic Avatar asked Sep 21 '17 18:09

vic


People also ask

What are the 4 types of currency?

The 4 different types of money as classified by the economists are commercial money, fiduciary money, fiat money, commodity money. Money whose value comes from a commodity of which it is made is known as commodity money.

What data type should I use for currency?

Unlike the DECIMAL data type, the MONEY data type is always treated as a fixed-point decimal number. The database server defines the data type MONEY(p) as DECIMAL(p,2). If the precision and scale are not specified, the database server defines a MONEY column as DECIMAL(16,2).

What are the 3 types of money?

Economists differentiate among three different types of money: commodity money, fiat money, and bank money.

What is the datatype for currency in Java?

1 Answer. Java has Currency class that represents the ISO 4217 currency codes. BigDecimal is the best type for representing currency decimal values.


1 Answers

There is no built-in "currency" type. You would typically use type: number with an optional format modifier to indicate the meaning of the numeric type:

type: number
format: currency

format can have arbitrary values, so you can use format: currency or format: decimal or whatever your tool supports. Tools that recognize the given format will map the value to the corresponding type.

like image 62
Helen Avatar answered Oct 20 '22 20:10

Helen