MCPcopy Create free account
hub / github.com/buke/quickjs-go / ToBigInt

Method ToBigInt

value.go:226–232  ·  view source on GitHub ↗

ToBigInt returns the big.Int value of the value.

()

Source from the content-addressed store, hash-verified

224
225// ToBigInt returns the big.Int value of the value.
226func (v *Value) ToBigInt() *big.Int {
227 if !v.IsBigInt() {
228 return nil
229 }
230 val, _ := new(big.Int).SetString(v.ToString(), 10)
231 return val
232}
233
234// ToNumber returns the numeric value as a new JavaScript Number.
235func (v *Value) ToNumber() (*Value, error) {

Callers 4

BigIntMethod · 0.95
unmarshalMethod · 0.80
unmarshalInterfaceMethod · 0.80
TestValueConversionsFunction · 0.80

Calls 2

IsBigIntMethod · 0.95
ToStringMethod · 0.95

Tested by 1

TestValueConversionsFunction · 0.64