aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/json-iterator/go/feature_json_number.go
blob: 0439f67252834b733c235c6ca95eace7eca9c43a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package jsoniter

import "encoding/json"

type Number string

func CastJsonNumber(val interface{}) (string, bool) {
	switch typedVal := val.(type) {
	case json.Number:
		return string(typedVal), true
	case Number:
		return string(typedVal), true
	}
	return "", false
}