DECIMAL(10,2) means you can have a decimal number with a maximal total precision of 10 digits. Two (2) of them after the decimal point and eight (8) before. It is not so important why this is used. It is important to know how it works. The idea is to have option for bigger salaries.
- It is defined as `numeric(p, s)`, where `p` is the precision (total number of digits), and `s` is the scale (number of digits to the right of the decimal point). - Example: `numeric(10, 2)` can store numbers with up to 10 digits, 2 of which can be to the right of the decimal point.
Weight Decimal (5,2) means the total number of digits cannot exceed 5 and 2 digits can be placed to the right of the decimal. However, the value 1000.45 in the second line of code above exceeds the specified range of (5, 2) since it means 6 digits in total and throws an overflow error.
When it says NUMBER(8,2), it means that there will be 8 digits, and that the number should be rounded to the nearest hundredth. Which means that there will be 6 digits before, and 2 digits after the decimal point.
As you see, DECIMAL(10,4) defines a number containing a total of ten digits, with four to the right of the decimal place. It follows there are six to the left.
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 .
Address: 787 Elvis Divide, Port Brice, OH 24507-6802
Phone: +9779049645255
Job: Senior Healthcare Specialist
Hobby: Cycling, Model building, Kitesurfing, Origami, Lapidary, Dance, Basketball
Introduction: My name is Sen. Emmett Berge, I am a funny, vast, charming, courageous, enthusiastic, jolly, famous person who loves writing and wants to share my knowledge and understanding with you.
We notice you're using an ad blocker
Without advertising income, we can't keep making this site awesome for you.