(sValue string, isNull bool)
| 98 | } |
| 99 | |
| 100 | func NewNumericFromJSONString(sValue string, isNull bool) Numeric { |
| 101 | if isNull { |
| 102 | return NewNullNumeric() |
| 103 | } |
| 104 | if sValue == JSON_INFINITY { |
| 105 | return INFINITY |
| 106 | } |
| 107 | if sValue == JSON_NEGATIVE_INFINITY { |
| 108 | return NEGATIVE_INFINITY |
| 109 | } |
| 110 | if sValue == JSON_NAN { |
| 111 | return NAN |
| 112 | } |
| 113 | iValue, _ := strconv.ParseInt(sValue, 10, 64) |
| 114 | dValue, _ := strconv.ParseFloat(sValue, 64) |
| 115 | return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNull} |
| 116 | } |
| 117 | |
| 118 | func NewNullNumeric() Numeric { |
| 119 | return &numeric{iValue: 0, dValue: 0.0, sValue: "", isNil: true} |
no test coverage detected