Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class DecimalSettingsAttribute

Use this attribute to declare a property to have precision and scale.

Inheritance
System.Object
DecimalSettingsAttribute
Namespace: EPiServer.Commerce.Catalog.DataAnnotations
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0
Syntax
public class DecimalSettingsAttribute : Attribute
Examples
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Commerce.Catalog.DataAnnotations;
using EPiServer.Core;
using EPiServer.DataAnnotations;

namespace CodeSamples.EPiServer.Commerce.Catalog.Provider
{
[CatalogContentType]
public class CatalogContentTypeSample : VariationContent
{
[CultureSpecific]
[Tokenize]
[Encrypted]
[UseInComparison]
[IncludeValuesInSearchResults]
[IncludeInDefaultSearch]
[SortableInSearchResults]
public virtual string Description { get; set; }

public virtual int Size { get; set; }

[DecimalSettings(18, 0)]
public virtual decimal Discount { get; set; }
}
}

Constructors

DecimalSettingsAttribute(Byte, Byte)

Initializes a new instance of the DecimalSettingsAttribute class.

Declaration
public DecimalSettingsAttribute(byte precision, byte scale)
Parameters
Type Name Description
System.Byte precision

The precision.

System.Byte scale

The scale.

Properties

Precision

Gets the precision.

Declaration
public virtual byte Precision { get; }
Property Value
Type Description
System.Byte

Scale

Gets the scale.

Declaration
public virtual byte Scale { get; }
Property Value
Type Description
System.Byte