Skip to content

Add minDecimals to output of getFormatInfo() - #79

Open
yelper wants to merge 2 commits into
borgar:masterfrom
yelper:dev/alsarika/add-min-decimals-info
Open

Add minDecimals to output of getFormatInfo()#79
yelper wants to merge 2 commits into
borgar:masterfrom
yelper:dev/alsarika/add-min-decimals-info

Conversation

@yelper

@yelper yelper commented Aug 28, 2026

Copy link
Copy Markdown

I found that when I was trying to use getFormatInfo() to get metadata about formats that "0.0" and "0.#", the info function returned the exact same FormatInfo objects.

To differentiate them, I thought it was natural to support a minDecimals property as part of FormatInfo. This PR adds the ability to return this metadata.

Supporting something like minDecimals would help pass correct downstream information to other functionality, like compaction of numbers using something like Intl.NumberFormat, setting minimumFractionDigits and maximumFractionDigits (see MDN).

AI note: I used GPT 5.4 Sol to initially author the PR, but then personally reviewed all code/doc changes.

@borgar

borgar commented Sep 3, 2026

Copy link
Copy Markdown
Owner

I like the change but I'm doing a TS rewrite so I've just created major conflicts on this branch. Sorry about that. You'll need to update this patch against the new code.

I'd prefer if you didn't include build results (API.md or dist/*) in the PR; they will get produced when a release happens.

@yelper

yelper commented Sep 3, 2026

Copy link
Copy Markdown
Author

Will do! No worries about conflicts, I'm happy to resolve.

@yelper
yelper force-pushed the dev/alsarika/add-min-decimals-info branch from afb9488 to 6fda0a2 Compare September 4, 2026 22:25
@yelper

yelper commented Sep 4, 2026

Copy link
Copy Markdown
Author

Updated to match refactor!

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.

2 participants