Function UnitPrefixFilter

  • A filter used to format a number with the prefix and unit

    Arguments:

    • opt_unit: The unit to used, default is ''.
    • opt_type: (unit|square|binary) the type of units, default is 'unit'.
    • opt_precision: The used precision, default is 3.

    Examples:

     {{25000 | ngeoUnitPrefix}} => 25 k
    {{25000 | ngeoUnitPrefix:'m'}} => 25 km
    {{25000000 | ngeoUnitPrefix:'m²':'square'}} => 25 km²
    {{2048 | ngeoUnitPrefix:'o':'binary'}} => 2 Kio

    Returns

    Function used to format number into a string.

    Ng Inject

    Ngdoc

    filter

    Ngname

    ngeoUnitPrefix

    Parameters

    • $filter: IFilterService

      Angular filter

    Returns unitPrefix

Generated using TypeDoc