[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/common/formatNumber [Back]  [Original]

formatNumber Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/common

formatNumber

function
stable

Formats a number as text, with group sizing, separator, and other parameters based on the locale.

Internationalization (i18n) Guide

On this page

    arrow_upward_alt Back to the top

    API

    function formatNumber(
      value: number,
      locale: string,
      digitsInfo?: string | undefined,
    ): string;
    @paramvaluenumber

    The number to format.

    @paramlocalestring

    A locale code for the locale format rules to use.

    @paramdigitsInfostring | undefined

    Decimal representation options, specified by a string in the following format: {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}. See DecimalPipe for more details.

    @returnsstring

    The formatted text string.

    Description

    Formats a number as text, with group sizing, separator, and other parameters based on the locale.


    Exported by

    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page