Skip to main content
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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