name_masked
name_masked

Reputation: 9794

Decimal precision - C#

All,

For a decimal value of 1 billion being retrieved from SQL Server where the associated datatype is Numeric (28,10), I am running into Conversion overflow exception. From MSDN:

The .NET Framework decimal data type allows a maximum of 28 significant digits

I need to clarify if the digits here refer to the binary form or decimal form itself?

Upvotes: 2

Views: 5985

Answers (3)

Barry Kaye
Barry Kaye

Reputation: 7761

In SQL Server for Numeric and Decimal datatypes, this defines a maximum of 28 decimal digits in total (the precision) with a maximum of 10 decimal places to the right of the decimal point (the scale), thus giving a maximum of 18 dp to the left of the point.

Upvotes: 5

Nivid Dholakia
Nivid Dholakia

Reputation: 5442

Its Decimal digits that it will accept max of 28 digits.

Upvotes: 1

David Heffernan
David Heffernan

Reputation: 612794

The limitation is imposed by the decimal representation and the 28 significant digits refer to 28 decimal digits.

Upvotes: 3

Related Questions