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

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Member

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;

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

Owner

mythz commented Mar 23, 2013

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

Member

angelcolmenares commented Mar 23, 2013

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

Member

tgrassau commented Mar 25, 2013

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

Member

angelcolmenares commented Apr 24, 2013

hi,
@mythz , @brainless83
no news about this request?

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

public class GeoLocation
{
    [AutoIncrement]
    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

Owner

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