SpreadJS 13
GC.Spread.Formatter Namespace / GeneralFormatter class / format Method
The object with cell data to format.
The object with formatted data.
The formatted data array, each item is an object that has two properties type and value, And it may contain these types: 'number', 'text', 'fillingChar', 'placeholder', 'exponent', 'decimalSeparator', 'groupSeparator', 'numberPlaceholder', 'percent', 'permille' and 'currency'. For example: {type: 'number', value: '123'}.
The conditional foreground color.
In This Topic
    format Method
    In This Topic
    Formats the specified object as a string with a formatted data Object.
    Syntax
    var instance = new GC.Spread.Formatter.GeneralFormatter(format, cultureName);
    var value; // Type: string
    value = instance.format(obj,
                            formattedData,
                            formattedData.content,
                            formattedData.conditionalForeColor);
    function format( 
       obj : Object,
       formattedData : Object,
       (optional) formattedData.content : Array,
       (optional) formattedData.conditionalForeColor : string
    ) : string;

    Parameters

    obj
    The object with cell data to format.
    formattedData
    The object with formatted data.
    formattedData.content
    The formatted data array, each item is an object that has two properties type and value, And it may contain these types: 'number', 'text', 'fillingChar', 'placeholder', 'exponent', 'decimalSeparator', 'groupSeparator', 'numberPlaceholder', 'percent', 'permille' and 'currency'. For example: {type: 'number', value: '123'}.
    formattedData.conditionalForeColor
    The conditional foreground color.

    Return Value

    The formatted string.
    See Also