fix(logs): don't render numbers with >13 digits using commas#112354
Merged
JoshuaKGoldberg merged 1 commit intomasterfrom Apr 7, 2026
Merged
fix(logs): don't render numbers with >13 digits using commas#112354JoshuaKGoldberg merged 1 commit intomasterfrom
JoshuaKGoldberg merged 1 commit intomasterfrom
Conversation
7846720 to
35f4ca7
Compare
35f4ca7 to
f7aedb4
Compare
f7aedb4 to
e864c93
Compare
Move number formatting out of fieldRenderers into a shared util, preserving locale string output and the >10B fast path to avoid float truncation. Add unit tests for formatNumber and integration-style tests for the number field type in getFieldRenderer. Co-Authored-By: Cursor <noreply@cursor.com> Made-with: Cursor
e864c93 to
5d90b14
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Formatting function has inconsistent return type
- Changed formatNumber to return String(value) for large numbers instead of raw number, ensuring consistent string return type across all code paths and aligning with other formatting utilities.
Or push these changes by commenting:
@cursor push 0f0e338f92
Preview (0f0e338f92)
diff --git a/static/app/utils/number/formatNumber.spec.ts b/static/app/utils/number/formatNumber.spec.ts
--- a/static/app/utils/number/formatNumber.spec.ts
+++ b/static/app/utils/number/formatNumber.spec.ts
@@ -10,11 +10,11 @@
});
it('returns the value when the value has 14 digits', () => {
- expect(formatNumber(12_345_678_901_234)).toBe(12345678901234);
+ expect(formatNumber(12_345_678_901_234)).toBe('12345678901234');
});
it('returns the value when the value has 15 digits', () => {
- expect(formatNumber(123_456_789_012_345)).toBe(123456789012345);
+ expect(formatNumber(123_456_789_012_345)).toBe('123456789012345');
});
it('returns the value when the value does not have digits', () => {
diff --git a/static/app/utils/number/formatNumber.ts b/static/app/utils/number/formatNumber.ts
--- a/static/app/utils/number/formatNumber.ts
+++ b/static/app/utils/number/formatNumber.ts
@@ -4,7 +4,7 @@
export function formatNumber(value: number) {
if (value >= 10_000_000_000_000) {
- return value;
+ return String(value);
}
return formatFloat(value, NUMBER_MAX_FRACTION_DIGITS).toLocaleString(undefined, {This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5d90b14. Configure here.
nsdeschenes
approved these changes
Apr 7, 2026
Contributor
nsdeschenes
left a comment
There was a problem hiding this comment.
All looks good, can you update the PR title to match the changes as well, just so the commit message matches everything 🙏
Member
Author
|
D'oh! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Extracts a
formatNumberhelper for the numeric field renderer. It bypassesformatFloatfor numbers that have over 13 digits.Tangentially related:
Fixes EXP-866.