Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Precision and Scale for decimal types #208

wants to merge 1 commit into


None yet
4 participants

angelcolmenares commented Mar 23, 2013

using DecimalLengthAttribute, precision and scale can be set ;

public decimal SomeDecimal {get set; }
will produce:
for mysql: .... SomeDecimal DECIMAL (38,6) NOT NULL;
for the rest: ... SomeDecimal DECIMAL (18,12) NOT NULL;

public decimal SomeDecimalWithPrecisionAndScale {get;set; }
will produce: SomeDecimal DECIMAL (15,2) NOT NULL;


mythz commented Mar 23, 2013

ok, as this deals with MySql field precision, it's best to get @brainless83 to review it.


angelcolmenares commented Mar 23, 2013

OrmLiteDialectProviderBase.GetColumnDefinition was changed, so it affects all dialects!


tgrassau commented Mar 25, 2013

I am kind of busy right now, I will take a look at this within the next few days


angelcolmenares commented Apr 24, 2013

@mythz , @brainless83
no news about this request?

Example use that I would like to have this attribute for.

public class GeoLocation
    public long Id { get; set; }
    //[DecimalLength(9, 6)] //Want to use this.
    public decimal Latitude { get; set; }
    //[DecimalLength(9, 6)] //Want to use this.
    public decimal Longitude { get; set; }

@angelcolmenares I am not sure what database you mean by 'for the rest' .. for me (SQLSERVER2012) OrmLite makes DECIMAL (38,6) NOT NULL


mythz commented Oct 31, 2013

can't be merged cleanly, cleaning up.

@mythz mythz closed this Oct 31, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment