mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
fix(quote): report missing change and volume as null, not zero
change, change_pct and volume were `unwrap_or(0)` when the provider omitted them (MSN quotes and screener rows; Yahoo with no previous close), so "unknown" read as "unchanged, zero volume". They are now Option fields that serialize as null when missing. The table shows "-", and the performers screens sort unknown changes last in both directions. Present values are unchanged and cached entries still load. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ld3fDSDiBzAaQvgZJX5NKM
This commit is contained in:
parent
4ddf1118d4
commit
135034966c
6 changed files with 106 additions and 62 deletions
|
|
@ -49,8 +49,8 @@ mod tests {
|
|||
let quote = parse_quote_from_str("BBCA.JK", &raw).expect("quote parsed");
|
||||
assert_eq!(quote.symbol, "BBCA.JK");
|
||||
assert_eq!(quote.price, 9875);
|
||||
assert_eq!(quote.change, 117);
|
||||
assert_eq!(quote.volume, 12_300_000);
|
||||
assert_eq!(quote.change, Some(117));
|
||||
assert_eq!(quote.volume, Some(12_300_000));
|
||||
assert_eq!(quote.market_cap, Some(1_215_200_000_000_000));
|
||||
assert_eq!(quote.avg_volume, Some(10_000_000));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue