blob: e1bffd956ef1fac959f3e3a8177d479ef7dadc07 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
package model
import "strconv"
type NumberNode struct {
Value float64
}
func (n NumberNode) Type() NodeType {
return NumberType
}
func (n *NumberNode) MarshalJSON() ([]byte, error) {
return []byte(strconv.FormatFloat(n.Value, 'g', -1, 64)), nil
}
|