# CurrencyValidationRule

Namespace: **Wisej.Web**

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

* [ValidationRule](/api/wisej.web/extenders/validation/wisej.web.validationrule.md)
  * [CurrencyValidationRule](/api/wisej.web/extenders/validation/wisej.web.currencyvalidationrule.md)

Validates currency values.

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

```csharp
public class CurrencyValidationRule : ValidationRule
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) CurrencyValidationRule()

Initializes a new instance of the [CurrencyValidationRule](/api/wisej.web/extenders/validation/wisej.web.currencyvalidationrule.md) class.

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) CurrencySymbol

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the currency symbol to validate. The default is null to use the current [CurrencySymbol](https://docs.microsoft.com/dotnet/api/system.globalization.numberformatinfo.currencysymbol). (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) DecimalDigits

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Name

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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

### ![](/files/hsR4ok3152WyAf8J2C1u) OnValidated(control)

Invoked after the control has been successfully validated.

| Parameter   | Type                                         | Description |
| ----------- | -------------------------------------------- | ----------- |
| **control** | [Control](/api/wisej.web/general/control.md) |             |

### ![](/files/hsR4ok3152WyAf8J2C1u) OnValidating(control)

Validates the *control* using the validation rule.

| Parameter   | Type                                         | Description |
| ----------- | -------------------------------------------- | ----------- |
| **control** | [Control](/api/wisej.web/general/control.md) |             |

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/extenders/validation/wisej.web.currencyvalidationrule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
