officefileapi-devexpress-dot-spreadsheet-dot-formatting-d1a95ee0.md
Specifies a number format for a numeric cell value based on the current (local) culture.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
string NumberFormatLocal { get; set; }
Property NumberFormatLocal As String
| Type | Description |
|---|---|
| String |
The local number format.
|
The Spreadsheet uses Microsoft Excel number formats to display cell numbers as percentage, decimal, currency, accounting, and date/time values.
The NumberFormatLocal property allows you to obtain or specify a number format based on the local culture defined by the DocumentOptions.Culture property.
using DevExpress.Spreadsheet;
using System;
using System.Globalization;
// ...
// Change culture for the Spreadsheet control.
spreadsheetControl1.Options.Culture = new CultureInfo("fr-FR");
// Create a cell and set its value.
CellRange cell = worksheet.Range["A1"];
cell.Value = DateTime.Now;
// Apply a date format to the cell in the invariant culture.
cell.NumberFormat = "mm-dd-yy";
// Obtain the applied date format in the French culture.
// The returned value is "jj/mm/aaaa".
string localFormat = cell.NumberFormatLocal;
Imports DevExpress.Spreadsheet
Imports System
Imports System.Globalization
' ...
' Change culture for the Spreadsheet control.
spreadsheetControl1.Options.Culture = New CultureInfo("fr-FR")
' Create a cell and set its value.
Dim cell As CellRange = worksheet.Range("A1")
cell.Value = DateTime.Now
' Apply a date format to the cell in the invariant culture.
cell.NumberFormat = "mm-dd-yy"
' Obtain the applied date format in the French culture.
' The returned value is "jj/mm/aaaa".
Dim localFormat As String = cell.NumberFormatLocal
Use the Formatting.NumberFormat option to obtain or specify a cell number format in the invariant culture.
See Also