# DecimalValidationRule

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (3.2.0.0)

* [ValidationRule](https://docs.wisej.com/api/v3.2/wisej.web/extenders/validation/wisej.web.validationrule)
  * [DecimalValidationRule](https://docs.wisej.com/api/v3.2/wisej.web/extenders/validation/wisej.web.decimalvalidationrule)

Validates decimal values.

{% tabs %}
{% tab title="C#" %}

```csharp
public class DecimalValidationRule : ValidationRule
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DecimalValidationRule
    Inherits ValidationRule
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)DecimalValidationRule()

Initializes a new instance of the [DecimalValidationRule](https://docs.wisej.com/api/v3.2/wisej.web/extenders/validation/wisej.web.decimalvalidationrule) class.

## Properties

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)DecimalDigits

[Nullable\<Int32>](https://docs.microsoft.com/dotnet/api/system.nullable-1): Returns or sets the required number of decimal digits; or null to allow any number of decimals. (Default: `null`)

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)Format

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether to format the value of the control after validation. (Default: `False`)

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)MaximumValue

[Nullable\<Decimal>](https://docs.microsoft.com/dotnet/api/system.nullable-1): Returns or sets the maximum value; or null for no maximum. (Default: `null`)

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)MinimumValue

[Nullable\<Decimal>](https://docs.microsoft.com/dotnet/api/system.nullable-1): Returns or sets the minimum value; or null for no minimum. (Default: `null`)

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)Name

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the name of the validation rule. (Default: `"Decimal"`)

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)Required

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the control can be empty or its required to have a value. (Default: `False`)

## Methods

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)OnValidated(control)

Invoked after the control has been successfully validated.

| Parameter   | Type                                                                 | Description |
| ----------- | -------------------------------------------------------------------- | ----------- |
| **control** | [Control](https://docs.wisej.com/api/v3.2/wisej.web/general/control) |             |

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)OnValidating(control)

Validates the *control* using the validation rule.

| Parameter   | Type                                                                 | Description |
| ----------- | -------------------------------------------------------------------- | ----------- |
| **control** | [Control](https://docs.wisej.com/api/v3.2/wisej.web/general/control) |             |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the validation is successful; otherwise false.
