( num: string | number | null | undefined, localeOptions?: FrontendLocaleData, precision?: number | undefined, )
| 310 | } |
| 311 | |
| 312 | export function myFormatNumber( |
| 313 | num: string | number | null | undefined, |
| 314 | localeOptions?: FrontendLocaleData, |
| 315 | precision?: number | undefined, |
| 316 | ): string | null { |
| 317 | let lValue: string | number | null | undefined = num; |
| 318 | if (lValue === undefined || lValue === null) return null; |
| 319 | if (typeof lValue === 'string') { |
| 320 | lValue = parseFloat(lValue); |
| 321 | if (Number.isNaN(lValue)) { |
| 322 | return num as string; |
| 323 | } |
| 324 | } |
| 325 | return formatNumber(lValue, localeOptions, { |
| 326 | maximumFractionDigits: precision === undefined ? DEFAULT_FLOAT_PRECISION : precision, |
| 327 | }); |
| 328 | } |
| 329 | |
| 330 | export function computeTimezoneDiffWithLocal(timezone: string | undefined): number { |
| 331 | if (!timezone) return 0; |
no outgoing calls
no test coverage detected