Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datatype decimal(6, 2)

Tags:

types

If I have a datatype of decimal(6, 2) what would a sample data be?

I'm using ASP.NET MVC if that makes a difference. Thanks.

like image 891
Cameron Avatar asked Mar 27 '11 21:03

Cameron


People also ask

What is the data type for a decimal?

The decimal data type is a machine-independent method that represents numbers of up to 32 significant digits, with valid values in the range 10 -129 - 10 +125. When you define a column with the DECIMAL( p ) data type, it has a total of p (< = 32) significant digits.

What is the data type for decimal in SQL?

Standard SQL requires that DECIMAL(5,2) be able to store any value with five digits and two decimals, so values that can be stored in the salary column range from -999.99 to 999.99 . In standard SQL, the syntax DECIMAL( M ) is equivalent to DECIMAL( M ,0) .

What is the meaning of number 10 2 in SQL?

If the scale is negative, the actual data is rounded to the specified number of places to the left of the decimal point. For example, a specification of (10,-2) means to round to hundreds.

What is the meaning of the following statement decimal 8 2?

For example, DECIMAL(8,2) can hold the value 123456.78 (8 (p) = 6 digits on the left + 2 (s) digits of the right of the decimal point).


1 Answers

Assuming you mean that the database type is decimal(6, 2), then this means that your column is set up to store 6 places (scale), with 2 to the right of the decimal (precision). You should treat this as a decimal CLR type.

A sample would be 1234.56.

like image 74
Jarrett Meyer Avatar answered Oct 21 '22 18:10

Jarrett Meyer