What is the equivalent datatype of SQL Server's Numeric in C# -
in sql server can write data numeric(15,10)
.. equivalent of in c#?
i know numeric
's equivalent decimal
how represent numeric(15,10)
?
there isn't direct equivalent, in there no built-in .net types allow specify precision/scale explicitly far i'm aware. there's no fixed-point type numeric.
decimal
, double
common floating point types in .net, decimal
implementing decimal floating point (like numeric in t-sql) , double
implementing binary floating point behaviour (like float , real in t-sql). (there's float
well, smaller binary floating point type.)
you should choose between decimal
, double
based on values you're going represent - typically think of "man-made", artificial values (particularly money) being appropriate decimal
, , continuous, natural values (such physical dimensions) being appropriate double
.
Comments
Post a Comment