Skip to content

Fix BONanza chat number formatting edge case - #25

Merged
maghuro merged 5 commits into
mainfrom
fix/bonanza-chat-number-formatting
Oct 2, 2026
Merged

maghuro merged 5 commits into
mainfrom
fix/bonanza-chat-number-formatting

Conversation

@maghuro

@maghuro maghuro commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • fix formatChatNumbersWithSpaces() so comma-separated giveaway number lists are never collapsed into a fake thousands-grouped value
  • avoid digit-bearing usernames such as Sch2021 triggering unrelated number formatting
  • keep genuine thousands formats (1000, 1,000, 1 000, 1'000, 1’000) normalized to spaces
  • add regression coverage for the exact live failure (28, 36, 52, 83, 89 -> 28, 365 283, 89) and the ambiguous 28, 365 list case
  • bump BONanza to v1.5.13 and rebuild the generated userscript

Root cause

The old formatter first woke up on any four consecutive digits anywhere in the message (including Sch2021), then used a permissive regex that treated commas and whitespace as part of one numeric token. That allowed 36, 52, 83 to be collapsed to 365283 and re-formatted as 365 283.

Expected behavior

Only a single lexical numeric token is formatted at a time. Comma thousands grouping requires no following space, which keeps normal giveaway list syntax (28, 365, ...) unambiguous.

@maghuro
maghuro merged commit 895169e into main Oct 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant