Skip to main content
Row

Formatting.NumberFormatLocal Property

Specifies a number format for a numeric cell value based on the current (local) culture.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

string NumberFormatLocal { get; set; }

Property Value

Type Description
String

The local number format.

Remarks

The Spreadsheet uses Microsoft Excel number formats to display cell numbers as percentage, decimal, currency, accounting, and date/time values.

Spreadsheet number formats

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;

Use the Formatting.NumberFormat option to obtain or specify a cell number format in the invariant culture.

See Also