# NumberFormatException Class

> The NumberFormatException class informs about an invalid syntax of a numberformat used to display a formula result.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 26.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Inherits:** `System.Exception`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > NumberFormatException Class
- **393 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/numberformatexception/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/numberformatexception/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/numberformatexception/llms-full.txt

---

### Description

The NumberFormatException class informs about an invalid syntax of a numberformat used to display a formula result.

### Syntax

```csharp
public class NumberFormatException : Exception
```

```vbnet
Public Class NumberFormatException
    Inherits Exception
```

### Examples

The following example includes the message value from a Number Format Exception object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Message: {numberFormatException.Message}");
Console.WriteLine("Number Format Exception is ready for use.");
```

```vbnet
Console.WriteLine($"Message: {numberFormatException.Message}")
Console.WriteLine("Number Format Exception is ready for use.")
```

---

## In This Section

- [NumberFormatException.CharacterIndex Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/numberformatexception/characterindex-property/llms-full.txt): Gets the one-based character index of the first invalid character in the numberformat string.

---

## Nearby

- **Previous:** [NumberFormat Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/numberformat/enumeration/llms-full.txt)
- **Next:** [NumberFormatException.CharacterIndex Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/numberformatexception/characterindex-property/llms-full.txt)
