Position: Home page » Currency » SQL to convert numbers to currency format

SQL to convert numbers to currency format

Publish: 2021-04-24 13:37:57
1.

Currency field types generally include int, float, money / smallmoney, decimal / numeric

select according to the accuracy of the stored data:

int can only store integer money

The

money / smallmoney data types are accurate to one ten thousandth of the monetary unit they represent

decimal / numberic can customize the decimal places and the data precision that can be stored, so generally more people use this type

float is not suitable for currency which needs precise value

conclusion:

it is best to use money and decimal types in finance

if it is a simple calculation, the float type can be used, but the data fetched by the float type on some platforms is not so accurate, and the accuracy may be lost. Therefore, if the cost is not great in a stable performance platform, it is recommended to use the above two types

extended data:

SQL data type:

1, bit integer

bit data type is integer, its value can only be 0, 1 or null. This data type is used to store data with only two possible values, such as yes or no, true or false, on or off.

note: it is a data type that saves a lot of space. If it can meet the requirements, it should be used as much as possible

The

2, tinyint integer

tinyint data type can store integers from 0 to 255. It's useful when you're only going to store a limited number of values. This data type occupies 1 byte in the database

The

3, smallint integer

smallint data type can store integers from the 15th power (- 32768) of - 2 to the 15th power (32767) of 2. This kind of data type is very useful for storing some numerical data which is often limited in a specific range. This data type takes up two bytes of space in the database

The

4, int integer

int data type can store integers from the 31st power of - 2 (- 2147483648) to the 31st power of 2 (2147483647). Almost all numerical data stored in the database can use this data type. This data type takes up four bytes in the database

The

5, decimal precise numerical type

decimal data type can be used to store numerical data with fixed precision and range from - 10 to - 10. When using this data type, you must specify the range and precision. The range is the total number of digits that can be stored around the decimal point. Precision is the number of digits stored to the right of the decimal point

Numerical data type is similar to decimal

7, smallmoney

smallmoney data type is used to represent money and monetary value. This data type can store data from - 214748.3648 to 214748.3647, accurate to one ten thousandth of the monetary unit

8, money type

money data type is used to express money and monetary value. This data type can store data from - 922 billion to 922 billion, accurate to one ten thousandth of the monetary unit

9, float approximate value type

float data type is an approximate value type for floating-point numbers. Floating point numbers are approximate because not all numbers in their range can be expressed accurately. Floating point numbers can be any number from - 1.79e + 308 to 1.79e + 308

10, real approximate value

real data type is similar to floating-point number, it is approximate value type. It can represent floating-point numbers with values between - 3.40e + 38 and 3.40e + 38

2. Isn't it 17.70 yuan? What else?
3. In the area of shengousi, there used to be two turntables. At the West Point between the two turntables, there is a building. The first floor is the Netcom business hall. The price is not clear
4.

Director Sun Liqun and Secretary of the Party committee are responsible for the overall work of the center
deputy director Liu Bin is in charge of the office, personnel department, finance department, Liaoning venture capital guidance fund management center and network engineering department
deputy director Jiang Jianli is in charge of the macroeconomic early warning and forecasting center and Liaoning Provincial Information Center
deputy director Wang Jiaren is in charge of the information engineering evaluation department, information resources department, information resources department, etc Logistics office

5. No.1 Fuyou street, Xicheng District, Beijing 100031
for reference only
6. The network level should be responsible for the construction and maintenance of physical lines, network construction and daily maintenance, to ensure the normal operation and security of various application servers, as well as the maintenance and content update of internal and external websites. In addition, responsible for the daily handling of computer terminal failure and office application problems.
7. It should be a man with more than one woman. One of the female leaders was the first of a hierarchy and secretly helped the male leader to get together.
8. It's like saving Datang mm
9. Wu TA Feng (Wu TA Feng Feng) Chapter 1: split lion and tiger Chapter 2: Fury Chapter 3: punishment Chapter 4: three thousand illusions Chapter 5: Lingka Chapter 6: leaving Chapter 7: Nine turn Xuangong
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750