MCPcopy Index your code
hub / github.com/angular/angular / transform

Method transform

packages/common/src/pipes/number_pipe.ts:109–124  ·  view source on GitHub ↗
(
    value: number | string | null | undefined,
    digitsInfo?: string,
    locale?: string,
  )

Source from the content-addressed store, hash-verified

107 locale?: string,
108 ): string | null;
109 transform(
110 value: number | string | null | undefined,
111 digitsInfo?: string,
112 locale?: string,
113 ): string | null {
114 if (!isValue(value)) return null;
115
116 locale ||= this._locale;
117
118 try {
119 const num = strToNumber(value);
120 return formatNumber(num, locale, digitsInfo);
121 } catch (error) {
122 throw invalidPipeArgumentError(DecimalPipe, (error as Error).message);
123 }
124 }
125}
126
127/**

Callers

nothing calls this directly

Calls 4

formatNumberFunction · 0.90
invalidPipeArgumentErrorFunction · 0.90
isValueFunction · 0.85
strToNumberFunction · 0.85

Tested by

no test coverage detected