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:
ojy
2026-05-13 04:28:21 +00:00
parent 9219220270
commit 5348bf643a
2 changed files with 27 additions and 8 deletions

View File

@@ -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++; }