* * @param value The number to be formatted as a percentage. * @param digitsInfo Decimal representation options, specified by a string * in the following format: * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits} . * - `minIntegerDigits`: The minimum number
(
value: number | string | null | undefined,
digitsInfo?: string,
locale?: string,
)
| 176 | * See [Setting your app locale](guide/i18n/locale-id). |
| 177 | */ |
| 178 | transform( |
| 179 | value: number | string | null | undefined, |
| 180 | digitsInfo?: string, |
| 181 | locale?: string, |
| 182 | ): string | null { |
| 183 | if (!isValue(value)) return null; |
| 184 | locale ||= this._locale; |
| 185 | try { |
| 186 | const num = strToNumber(value); |
| 187 | return formatPercent(num, locale, digitsInfo); |
| 188 | } catch (error) { |
| 189 | throw invalidPipeArgumentError(PercentPipe, (error as Error).message); |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | /** |
nothing calls this directly
no test coverage detected