Skip to content
This repository was archived by the owner on Aug 1, 2026. It is now read-only.

Add TextFieldWidget::setFormatAsInteger - #145

Open
YannickMG wants to merge 1 commit into
CleanroomMC:masterfrom
YannickMG:feature/number-field-widget
Open

Add TextFieldWidget::setFormatAsInteger#145
YannickMG wants to merge 1 commit into
CleanroomMC:masterfrom
YannickMG:feature/number-field-widget

Conversation

@YannickMG

@YannickMGYannickMG commented May 20, 2025

Copy link
Copy Markdown
Contributor

Adds TextFieldWidget::setFormatAsInteger that formats a number as an integer with group separators. Not perfect, explicitly doesn't work with floating point numbers, but it's a start.

@Caedis

Copy link
Copy Markdown

Does that automatically get the locale correct group separator?

@YannickMG

Copy link
Copy Markdown
ContributorAuthor

Does that automatically get the locale correct group separator?

Yes. In 1.7.10 I had to override the locale to not get broken string separators in MUI2's local dev.
image

For 1.7.10 we can either force the locale or go with the option of patching the font file.

@YannickMG

YannickMG commented May 20, 2025

Copy link
Copy Markdown
ContributorAuthor

It's not quite ready yet I think.

I got this by typing at the end of the number:

java.lang.StringIndexOutOfBoundsException: Range [0, 9) outofboundsforlength7

@YannickMG
YannickMG marked this pull request as draft May 20, 2025 21:01
@YannickMG
YannickMGforce-pushed the feature/number-field-widget branch from 38b738c to f9dc674CompareMay 21, 2025 00:51
@YannickMG
YannickMGforce-pushed the feature/number-field-widget branch from f9dc674 to 8d67eeeCompareMay 21, 2025 00:54
@YannickMG
YannickMG marked this pull request as ready for review May 21, 2025 00:56
@YannickMGYannickMG changed the title Add experimental IntegerFieldWidgetAdd TextFieldWidget::setFormatAsIntegerMay 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@YannickMG@Caedis