Skip to content

Commit

Permalink
fix numbers in sql export
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Oct 7, 2018
1 parent a5d7bc2 commit 51890f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/tsl/squirrel_walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package tsl

import (
"fmt"
"strconv"

sq "github.com/Masterminds/squirrel"
)
Expand Down Expand Up @@ -164,7 +165,8 @@ func SquirrelWalk(n Node) (s sq.Sqlizer, err error) {
case IdentOp:
s = sq.Expr(n.Left.(string))
case NumberOp:
s = sq.Expr("%f", n.Left.(float64))
f := strconv.FormatFloat(n.Left.(float64), 'f', -1, 64)
s = sq.Expr(f)
case StringOp:
s = sq.Expr(n.Left.(string))
case AndOp, OrOp, AddOp, SubtractOp, MultiplyOp, DivideOp, ModuloOp:
Expand Down

0 comments on commit 51890f0

Please sign in to comment.