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

Function decodeInt

packages/ibkr/src/utils.ts:52–61  ·  view source on GitHub ↗
(fields: Iterator<string>, showUnset = false)

Source from the content-addressed store, hash-verified

50}
51
52export function decodeInt(fields: Iterator<string>, showUnset = false): number {
53 const r = fields.next()
54 if (r.done) throw new BadMessage('no more fields')
55 const s = r.value
56 if (showUnset) {
57 if (s === null || s === undefined || s.length === 0) return UNSET_INTEGER
58 return parseInt(s, 10)
59 }
60 return parseInt(s || '0', 10)
61}
62
63export function decodeFloat(fields: Iterator<string>, showUnset = false): number {
64 const r = fields.next()

Callers 15

decodeOrderIdMethod · 0.70
decodeContractFieldsMethod · 0.70
decodeOriginMethod · 0.70
decodeClientIdMethod · 0.70
decodePermIdMethod · 0.70
decodeShortSaleParamsMethod · 0.70
decodeAuctionStrategyMethod · 0.70
decodeDisplaySizeMethod · 0.70
decodeMinQtyMethod · 0.70
decodeOcaTypeMethod · 0.70
decodeParentIdMethod · 0.70
decodeTriggerMethodMethod · 0.70

Calls 1

nextMethod · 0.80

Tested by

no test coverage detected