|
@@ -4,6 +4,7 @@ import (
|
|
|
"bytes"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
+ "github.com/shopspring/decimal"
|
|
|
"hongze/hongze_edb_lib/utils"
|
|
|
"os"
|
|
|
"os/exec"
|
|
@@ -140,7 +141,7 @@ func ExecPythonCode(edbCode, reqCode string) (dataMap EdbDataFromPython, err err
|
|
|
if reflect.TypeOf(tmpValue) != nil {
|
|
|
if reflect.TypeOf(tmpValue).Kind() == reflect.Float64 {
|
|
|
dataMap.Date[i] = date
|
|
|
- dataMap.Value[i] = reflect.ValueOf(tmpValue).Float()
|
|
|
+ dataMap.Value[i], _ = decimal.NewFromFloat(reflect.ValueOf(tmpValue).Float()).Truncate(4).Float64() //保留4位小数
|
|
|
i++
|
|
|
}
|
|
|
}
|