It feels like a lot of stuff in the project, before the front page is to use the regular to deal with, and now because it is data query, so directly in the detection of data when it is converted to the designated thousand-bit format, the provincial front-end processing, do not speak the principle, because I also do not understand, but will use on the line, found on the Internet, and now record, Easy to see for yourself.
SQL gets the thousand bits of a number, that is, a number is three bits separated by commas, the SQL code is as follows:
(1) Without decimal points:
Select Reverse (stuff(reverse(varchar,convert(Money, 1234333000),1)),1,3,"))
This is a number without a decimal point, if the decimal point is imposed, the result of select is no decimal point, the result is: 1,234,333,000
(2) with decimal points:
Select Convert (varchar,cast(121565610000.012as Money),1)
This is a number with a decimal point, only two digits after the decimal point, if the number itself does not have a decimal place, will default to two 0, because of the last argument with convert (the value here is 1).
When the value is 1, it will be two decimal places, such as 123,000.00; When the value is 2, it will be 4 digits, such as 123,000.0000; When 0, the number will be output directly (that is, there is no comma separated, but there will be two decimal places, even if the original data has no decimal places), such as: 1230000.00.
SQL adds thousands of bits to numbers (that is, the format of money)