support scientific notation big floats
This commit is contained in:
committed by
Jack Christensen
parent
913e4c8487
commit
95b2f85e60
@@ -759,6 +759,14 @@ func (scanPlanTextAnyToNumericScanner) Scan(src []byte, dst any) error {
|
||||
return scanner.ScanNumeric(Numeric{InfinityModifier: NegativeInfinity, Valid: true})
|
||||
}
|
||||
|
||||
if strings.ContainsAny(string(src), "eE") {
|
||||
if bigF, ok := new(big.Float).SetString(string(src)); ok {
|
||||
smallF, _ := bigF.Float64()
|
||||
|
||||
src = []byte(strconv.FormatFloat(smallF, 'f', -1, int(bigF.Prec())))
|
||||
}
|
||||
}
|
||||
|
||||
num, exp, err := parseNumericString(string(src))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user