A few fixes and improvements#128
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces performance optimizations and formatting fixes to the decimal formatting utilities, as well as changes to the admin set command. The review feedback highlights three key issues: first, the zeroPad in DecimalFormatterImpl is calculated before rounding, which causes incorrect formatting for values that round up (e.g., 1.095 becoming 1.010 instead of 1.10); second, the optimized getLengthOfIntegralPart in DecimalFormatterUtil can trigger a StackOverflowError on Long.MIN_VALUE and suffers from precision loss with Math.log10 on large numbers; and third, the command constraints in AdminSetCommand prevent setting fractional balances between 0 and 1. Solutions are provided for each of these issues.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
This PR:
Command
/eco set <nick> 0Previously that command was telling
Only positive numbers allowed. Due to improper use of@Executeannotation expected syntax was/eco set 0 <nick>.Decimal formatting
All real numbers
X.YXX(whereXis non zero value andYis 0) were incorrectly formatted asX.XX.Eg.
1025->1.25kMath improvements
See the comments.