MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / decodeDecimal

Function decodeDecimal

packages/ibkr/src/utils.ts:82–98  ·  view source on GitHub ↗
(fields: Iterator<string>)

Source from the content-addressed store, hash-verified

80}
81
82export function decodeDecimal(fields: Iterator<string>): Decimal {
83 const r = fields.next()
84 if (r.done) throw new BadMessage('no more fields')
85 const s = r.value
86 if (
87 s === null ||
88 s === undefined ||
89 s.length === 0 ||
90 s === '2147483647' ||
91 s === '9223372036854775807' ||
92 s === '1.7976931348623157E308' ||
93 s === '-9223372036854775808'
94 ) {
95 return UNSET_DECIMAL
96 }
97 return new Decimal(s)
98}
99
100export function decodeLong(fields: Iterator<string>, showUnset = false): bigint {
101 const r = fields.next()

Callers 15

decodeTotalQuantityMethod · 0.85
decodeLmtPriceMethod · 0.85
decodeAuxPriceMethod · 0.85
decodeTrailParamsMethod · 0.85
decodeCashQtyMethod · 0.85
decodeFilledQuantityMethod · 0.85
processHistoricalDataMsgFunction · 0.85
processRealTimeBarMsgFunction · 0.85
processHistogramDataFunction · 0.85

Calls 1

nextMethod · 0.80

Tested by 1

roundTripFunction · 0.68