(value: string | number | null | undefined)
| 11 | * Handles null, undefined, empty strings, and number/string inputs. |
| 12 | */ |
| 13 | export function toDecimal(value: string | number | null | undefined): Decimal { |
| 14 | if (value === null || value === undefined || value === '') { |
| 15 | return new Decimal(0) |
| 16 | } |
| 17 | return new Decimal(value) |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Convert Decimal back to number for storage/API responses. |
no outgoing calls
no test coverage detected