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

Function floatMaxString

packages/ibkr/src/utils.ts:131–137  ·  view source on GitHub ↗
(val: number | null | undefined)

Source from the content-addressed store, hash-verified

129// Formatting helpers
130
131export function floatMaxString(val: number | null | undefined): string {
132 if (val == null) return ''
133 if (val === UNSET_DOUBLE) return ''
134 // Match Python's f"{val:.8f}".rstrip("0").rstrip(".").rstrip(",")
135 const s = val.toFixed(8)
136 return s.replace(/0+$/, '').replace(/\.$/, '').replace(/,$/, '')
137}
138
139export function longMaxString(val: bigint): string {
140 return val !== UNSET_LONG ? String(val) : ''

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected