Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 1.78 KB

File metadata and controls

60 lines (45 loc) · 1.78 KB
sidebar_label localization
title localization config
description You can learn about the localization config in the documentation of the DHTMLX JavaScript Spreadsheet library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Spreadsheet.

localization

Description

@short: 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