Helper to convert float64 to *big.Int with precision applied
(value float64, precision int64)
| 46 | |
| 47 | // Helper to convert float64 to *big.Int with precision applied |
| 48 | func floatToBigInt(value float64, precision int64) *big.Int { |
| 49 | decValue := decimal.NewFromFloat(value) |
| 50 | decPrecision := decimal.NewFromInt(precision) |
| 51 | preciseValue := decValue.Mul(decPrecision) |
| 52 | |
| 53 | return preciseValue.BigInt() |
| 54 | } |
| 55 | |
| 56 | // Helper to convert map of float64 to map of *big.Int with precision applied |
| 57 | func floatMapToBigIntMap(floatMap map[string]float64, precision int64) map[string]*big.Int { |
no outgoing calls
no test coverage detected