Round leg prices to 2 decimals everywhere
Entry price, mark and strike are now rounded to 2dp on add, on edit, on market reload, and on load (self-heals legacy entries) — fixes display of float artifacts like "15.000000001". Also persist the leg's locked/currentMark fields in the store. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -468,7 +468,7 @@
|
||||
if (!map) continue;
|
||||
const o = map[Number(leg.strike) + '@' + leg.type];
|
||||
if (!o) continue;
|
||||
const mark = o.midPrice ?? o.mid ?? o.bsPrice ?? 0;
|
||||
const mark = Math.round((o.midPrice ?? o.mid ?? o.bsPrice ?? 0) * 100) / 100;
|
||||
leg.currentMark = mark;
|
||||
if (o.iv > 0) leg.iv = o.iv;
|
||||
if (!leg.locked && mark > 0) { leg.entryPrice = mark; relinked++; }
|
||||
|
||||
Reference in New Issue
Block a user