NumberFormat
class NumberFormat extends Format (View source)
NumberFormat Object
Formats number values in the datatable for display. Added to columns during column definition.
Constants
| TYPE | 
                     Type of format object 
  | 
            
Methods
Builds the NumberFormat object with specified options
Shortcut method to set the value of an option and return $this.
Parses the config array by passing the values through each method to check validity against if the option exists.
Sets the character to use as the decimal marker.
A number specifying how many digits to display after the decimal.
A character to be used to group digits to the left of the decimal into sets of three.
The text color for negative values.
Sets whether negative values should be surrounded by parentheses.
A format string. When provided, all other options are ignored, except negativeColor.
Sets the string prefix for the value.
Sets the string suffix for the value.
Details
        at line 55
                            
    
    __construct(
    array $config = array())
    
    Builds the NumberFormat object with specified options
        in 
    JsonConfig at line 64
                            
    mixed
    __get(
    string $option)
    
    Get the value of a set option via magic method.
        in 
    JsonConfig at line 75
                            
    Options
    getOptions()
    
    Gets the Options object for the JsonConfig
        in 
    JsonConfig at line 90
                            
    JsonConfig
    setOption(
    string $option, 
    mixed $value)
    
    Shortcut method to set the value of an option and return $this.
In order to maintain backwards compatibility, ConfigObjects will be unwrapped.
        in 
    JsonConfig at line 106
                            
    
    setOptions(
    array $config)
    
    Parses the config array by passing the values through each method to check validity against if the option exists.
        in 
    JsonConfig at line 275
                            
    array
    jsonSerialize()
    
    Custom serialization of the JsonConfig object.
        in 
    Format at line 46
                            
    string
    getType()
    
    Returns the format type.
        at line 70
                            
    NumberFormat
    decimalSymbol(
    string $decimalSymbol)
    
    Sets the character to use as the decimal marker.
The default is a dot (.)
        at line 87
                            
    NumberFormat
    fractionDigits(
    integer $fractionDigits)
    
    A number specifying how many digits to display after the decimal.
The default is 2. If you specify more digits than the number contains, it will display zeros for the smaller values. Truncated values will be rounded (5 rounded up).
        at line 100
                            
    NumberFormat
    groupingSymbol(
    string $groupingSymbol)
    
    A character to be used to group digits to the left of the decimal into sets of three.
Default is a comma (,)
        at line 115
                            
    NumberFormat
    negativeColor(
    string $negativeColor)
    
    The text color for negative values.
No default value & values can be any acceptable HTML color value, such as "red" or "#FF0000".
        at line 129
                            
    NumberFormat
    negativeParens(
    boolean $negativeParens)
    
    Sets whether negative values should be surrounded by parentheses.
Default is true.
        at line 146
                            
    NumberFormat
    pattern(
    string $pattern)
    
    A format string. When provided, all other options are ignored, except negativeColor.
The format string is a subset of the ICU pattern set. For instance, {pattern:'#,###%'} will result in output values "1,000%", "750%", and "50%" for values 10, 7.5, and 0.5.
        at line 158
                            
    NumberFormat
    prefix(
    string $prefix)
    
    Sets the string prefix for the value.
        at line 170
                            
    NumberFormat
    suffix(
    string $suffix)
    
    Sets the string suffix for the value.