Skip to main content

localization

Description

Optional. Defines the format of numbers, dates, time and currency

Usage

localization?: object;

Parameters

The localization object may contain the following properties:

  • decimal - (optional) the symbol used as a decimal separator, "." by default.
    Possible values are "." | ","
  • thousands - (optional) the symbol used as a thousands separator, "," by default.
    Possible values are "." | "," | " " | ""
  • currency - (optional) the currency sign, "$" by default
  • dateFormat - (optional) the format of displaying dates set as a string. The default format is "%d/%m/%Y". Check the details at the dateFormat API page
  • timeFormat - (optional) the format of displaying time set as either 12 or 24. The default format is 12

Default config

const defaultLocales = {
decimal: ".",
thousands: ",",
currency: "$",
dateFormat: "%d/%m/%Y",
timeFormat: 12,
};

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
localization: {
decimal: ",",
thousands: " ",
currency: "¥",
dateFormat: "%D/%M/%Y",
timeFormat: 24
}
});

spreadsheet.parse(dataset);

Change log:

  • Added in v5.1

Related article: Number, date, time, currency localization