MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / parseValue

Function parseValue

internal/filter/values.go:7–32  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

5)
6
7func parseValue(value string) interface{} {
8 if intVal, err := strconv.ParseInt(value, 10, 64); err == nil {
9 return intVal
10 }
11
12 if floatVal, err := strconv.ParseFloat(value, 64); err == nil {
13 return floatVal
14 }
15
16 if value == "true" {
17 return true
18 }
19 if value == "false" {
20 return false
21 }
22
23 if timeVal, err := ParseDateTime(value); err == nil {
24 return TimestampValue{
25 Time: timeVal,
26 Original: value,
27 Precision: getDatePrecisionFromString(value),
28 }
29 }
30
31 return value
32}

Callers 1

ParseFromQueryFunction · 0.85

Calls 2

ParseDateTimeFunction · 0.85

Tested by

no test coverage detected