(item: PaddleProductLineItem)
| 40 | value.replace(/,(\d{2})$/, '.$1').replace(/[^\d.]/g, ''); |
| 41 | |
| 42 | export const getPrice = (item: PaddleProductLineItem): number => { |
| 43 | const priceAmount = parseFloat(item.totals.total); |
| 44 | const priceAmountFormatted = parseFloat( |
| 45 | removeNonNumber(item.formattedTotals.total), |
| 46 | ); |
| 47 | |
| 48 | if (priceAmount === priceAmountFormatted) { |
| 49 | return priceAmount; |
| 50 | } |
| 51 | |
| 52 | return priceAmount / 100; |
| 53 | }; |
| 54 | |
| 55 | export const formatDataTileValue = (value: number): string => { |
| 56 | if (typeof value !== 'number' || !Number.isFinite(value)) { |
no test coverage detected