# InputFormat.NumberFormat Property

> Gets or sets a number format which can be used to automatically format numbers in table cells. When a formula is defined the automatically calculated text can also be formatted with a number format. When a number format is not defined, the property's value is an empty string. The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats. See Formatting Text by using Number Formats for more information. If text is selected, the property specifies the number format of the whole selected text.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 26.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > InputFormat.NumberFormat Property
- **691 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/numberformat-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/numberformat-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/numberformat-property/llms-full.txt

---

### Description

Gets or sets a number format which can be used to automatically format numbers in table cells. When a formula is defined the automatically calculated text can also be formatted with a number format. When a number format is not defined, the property's value is an empty string. The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats. See Formatting Text by using Number Formats for more information. If text is selected, the property specifies the number format of the whole selected text.

### Syntax

```csharp
public string NumberFormat { get; set; }
```

```vbnet
Public Property NumberFormat As String
```

### Examples

The following example changes the formatting applied to text entered at the end of a document by using `InputFormat.NumberFormat`.

```csharp
textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;

inputFormat.NumberFormat = "0.00";
if (!string.IsNullOrWhiteSpace(inputFormat.NumberFormat))
{
    Console.WriteLine($"Number Format: {inputFormat.NumberFormat}");
}
```

```vbnet
textControl.Text = "Project summary"
textControl.InputPosition = New InputPosition(textControl.Text.Length)
Dim inputFormat As InputFormat = textControl.InputFormat

inputFormat.NumberFormat = "0.00"
If Not String.IsNullOrWhiteSpace(inputFormat.NumberFormat) Then
    Console.WriteLine($"Number Format: {inputFormat.NumberFormat}")
End If
```

### Remarks

The property returns null when the text selection contains multiple table cells with different number formats.

---

## Nearby

- **Previous:** [InputFormat.NumberedListFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/numberedlistformat-property/llms-full.txt)
- **Next:** [InputFormat.NumberFormats Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inputformat/numberformats-property/llms-full.txt)
