Class type Ext_util_Format.t


class type t = object .. end

method currencyAtEnd : bool Js.t Js.prop

This may be set to true to make the currency function append the currency sign to the formatted value.

This may be overridden in a locale file.

Defaults to: false

method currencyPrecision : Js.number Js.t Js.prop

The number of decimal places that the currency function displays.

This may be overridden in a locale file.

Defaults to: 2

method currencySign : Js.js_string Js.t Js.prop

The currency sign that the currency function displays.

This may be overridden in a locale file.

Defaults to: '$'

method decimalSeparator : Js.js_string Js.t Js.prop

The character that the number function uses as a decimal point.

This may be overridden in a locale file.

Defaults to: '.'

method thousandSeparator : Js.js_string Js.t Js.prop

The character that the number function uses as a thousand separator.

This may be overridden in a locale file.

Defaults to: ','

method attributes : 'a. 'a Js.t -> unit Js.meth

Formats an object of name value properties as HTML element attribute values suitable for using when creating textual markup.

Parameters:


method capitalize : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Alias for Ext.String.capitalize.

Capitalize the given string

Parameters:


method currency : 'b.
'b Js.t ->
Js.js_string Js.t Js.optdef ->
Js.number Js.t Js.optdef ->
bool Js.t Js.optdef -> Js.js_string Js.t Js.meth

Format a number as a currency.

Parameters:

Returns:


method date : 'c. 'c Js.t -> Js.js_string Js.t Js.optdef -> Js.js_string Js.t Js.meth

Formats the passed date using the specified format pattern.

Parameters:

Returns:


method dateRenderer : 'd. Js.js_string Js.t -> 'd Js.callback Js.meth

Returns a date rendering function that can be reused to apply a date format multiple times efficiently.

Parameters:

Returns:


method defaultValue : 'e. 'e Js.t -> Js.js_string Js.t Js.optdef -> Js.js_string Js.t Js.meth

Checks a reference and converts it to the default value if it's empty.

Parameters:


method ellipsis : Js.js_string Js.t ->
Js.number Js.t -> bool Js.t Js.optdef -> Js.js_string Js.t Js.meth

Alias for Ext.String.ellipsis.

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length.

Parameters:

Returns:


method escapeRegex : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Escapes the passed string for use in a regular expression.

Parameters:


method fileSize : 'f. 'f Js.t -> Js.js_string Js.t Js.meth

Simple format for a file size (xxx bytes, xxx KB, xxx MB).

Parameters:

Returns:


method format : 'g. Js.js_string Js.t -> 'g Js.t -> Js.js_string Js.t Js.meth

Alias for Ext.String.format.

Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each token must be unique, and must increment in the format {0}, {1}, etc. Example usage:

var cls = 'my-class',
    text = 'Some text';
var s = Ext.String.format('<div class="{0}">{1}</div>', cls, text);
// s now contains the string: '<div class="my-class">Some text</div>'

Parameters:

Returns:


method htmlDecode : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Alias for Ext.String.htmlDecode.

Convert certain characters (&, <, >, ', and ") from their HTML character equivalents.

Parameters:

Returns:


method htmlEncode : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Alias for Ext.String.htmlEncode.

Convert certain characters (&, <, >, ', and ") to their HTML character equivalents for literal display in web pages.

Parameters:

Returns:


method leftPad : Js.js_string Js.t ->
Js.number Js.t -> Js.js_string Js.t Js.optdef -> Js.js_string Js.t Js.meth

Alias for Ext.String.leftPad.

Pads the left side of a string with a specified character. This is especially useful for normalizing number and date strings. Example usage:

var s = Ext.String.leftPad('123', 5, '0');
// s now contains the string: '00123'

Parameters:

Returns:


method lowercase : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Converts a string to all lower case letters.

Parameters:

Returns:


method math : 'h. 'h Js.callback Js.meth

It does simple math for use in a template, for example:

var tpl = new Ext.Template('{value} * 10 = {value:math("* 10")}');

Returns:


method nl2br : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Converts newline characters to the HTML tag <br/>

Parameters:

Returns:


method number : Js.number Js.t -> Js.js_string Js.t -> Js.js_string Js.t Js.meth

Formats the passed number according to the passed format string.

The number of digits after the decimal separator character specifies the number of decimal places in the resulting string. The local-specific decimal character is used in the result.

The presence of a thousand separator character in the format string specifies that the locale-specific thousand separator (if any) is inserted separating thousand groups.

By default, "," is expected as the thousand separator, and "." is expected as the decimal separator.

New to Ext JS 4

Locale-specific characters are always used in the formatted output when inserting thousand and decimal separators.

The format string must specify separator characters according to US/UK conventions ("," as the thousand separator, and "." as the decimal separator)

To allow specification of format strings according to local conventions for separator characters, add the string /i to the end of the format string.

examples (123456.789):

Parameters:

Returns:


method numberRenderer : 'i. Js.js_string Js.t -> 'i Js.callback Js.meth

Returns a number rendering function that can be reused to apply a number format multiple times efficiently.

Parameters:

Returns:


method parseBox : 'j 'k. 'j Js.t -> 'k Js.t Js.meth

Parses a number or string representing margin sizes into an object. Supports CSS-style margin declarations (e.g. 10, "10", "10 10", "10 10 10" and "10 10 10 10" are all valid options and would return the same result).

Parameters:

Returns:


method plural : Js.number Js.t ->
Js.js_string Js.t -> Js.js_string Js.t Js.optdef -> unit Js.meth

Selectively do a plural form of a word based on a numeric value. For example, in a template, {commentCount:plural("Comment")} would result in "1 Comment" if commentCount was 1 or would be "x Comments" if the value is 0 or greater than 1.

Parameters:


method round : 'l. 'l Js.t -> Js.number Js.t -> Js.number Js.t Js.meth

Rounds the passed number to the required decimal precision.

Parameters:

Returns:


method stripScripts : 'm. 'm Js.t -> Js.js_string Js.t Js.meth

Strips all script tags.

Parameters:

Returns:


method stripTags : 'n. 'n Js.t -> Js.js_string Js.t Js.meth

Strips all HTML tags.

Parameters:

Returns:


method substr : Js.js_string Js.t ->
Js.number Js.t -> Js.number Js.t -> Js.js_string Js.t Js.meth

Returns a substring from within an original string.

Parameters:

Returns:


method trim : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Alias for Ext.String.trim.

Trims whitespace from either end of a string, leaving spaces within the string intact. Example:

var s = '  foo bar  ';
alert('-' + s + '-');                   //alerts "- foo bar -"
alert('-' + Ext.String.trim(s) + '-');  //alerts "-foo bar-"

Parameters:

Returns:


method undef : 'o 'p. 'o Js.t -> 'p Js.t Js.meth

Checks a reference and converts it to empty string if it is undefined.

Parameters:

Returns:


method uppercase : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Converts a string to all upper case letters.

Parameters:

Returns:


method usMoney : 'q. 'q Js.t -> Js.js_string Js.t Js.meth

Format a number as US currency.

Parameters:

Returns: