returns an object with configuration options necessary for formatting

object getConfig(string format);


formatstringthe number format set as a string


objectan object with formatting configuration options

The returned config object can contain the following attributes:

  • decimalSize - the number of decimal digits in the float number. By default, 2;
  • groupSize - the number of digits in a group. By default, 3;
  • decimalDelimiter - a char which separates the decimal part in the float number. By default, ".";
  • groupDelimiter - a char which separates groups of digits. By default, ",".
  • decimalOptional - boolean. If true, allows you not to specify the number of decimal digits in the float number.
  • prefix - string. Adds prefix to the formatted number.
  • sufix - string. Adds suffix to the formatted number.
  • minusPosition - string. The position of a negative sign.
  • minusSign - string|array. A sign for a negative number.

The current locale determines the values of the minusPosition and minusSign attributes (webix.i18n.minusPosition and webix.i18n.minusSign, respectively). 

const cfg = webix.Number.getConfig("1'111.00");
// ->{decimalSize: 2, groupSize: 3, decimalDelimiter: ".", groupDelimiter: "'",
//    minusPosition: "before", minusSign: "-", prefix: "", sufix: ""}
See also
Back to top