Skip to content

Commit 59ef703

Browse files
committed
Change output format picture for FormatFloat
1 parent fd3e384 commit 59ef703

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

business/tsextractor/tsextractor.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (a *TsExtractor) populateNumericTSDataIntoS3(
168168

169169
ts := response.Times[i]
170170
value := response.Values[i]
171-
samples = append(samples, composeRow(ts, thingID, thing.Name, propertyID, propertyName, strconv.FormatFloat(value, 'f', 3, 64)))
171+
samples = append(samples, composeRow(ts, thingID, thing.Name, propertyID, propertyName, strconv.FormatFloat(value, 'f', -1, 64)))
172172
}
173173
}
174174

@@ -349,7 +349,7 @@ func interfaceToString(value interface{}) string {
349349
case int:
350350
return strconv.Itoa(v)
351351
case float64:
352-
return strconv.FormatFloat(v, 'f', 3, 64)
352+
return strconv.FormatFloat(v, 'f', -1, 64)
353353
case bool:
354354
return strconv.FormatBool(v)
355355
default:

resources/test/localexecution.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func HandleRequest(ctx context.Context, dev bool) (*string, error) {
7979
}
8080
logger.Infoln("key:", *apikey)
8181
logger.Infoln("secret:", "*********")
82+
logger.Infoln("resolution:", *resolution)
8283
if organizationId != "" {
8384
logger.Infoln("organizationId:", organizationId)
8485
} else {
@@ -98,5 +99,11 @@ func HandleRequest(ctx context.Context, dev bool) (*string, error) {
9899
}
99100

100101
func main() {
101-
HandleRequest(context.Background(), true)
102+
msg, err := HandleRequest(context.Background(), true)
103+
if err != nil {
104+
logrus.Error(err)
105+
}
106+
if msg != nil {
107+
logrus.Info(*msg)
108+
}
102109
}

0 commit comments

Comments
 (0)