Open royalmustard opened 3 years ago
I agree that some manner of formatting would be useful here, but it should be implemented using locale-sensitive number formatting rather than specifically commas.
The normal way to do this would be:
I18n.format("translation.key", number);
where the translation key is
translation.key=EU %,d
The %,d will automatically add the locale specific separator.
Unfortunately, this only works on the client. For multiblocks, the screen output is constructed on the server which means you have to do:
new TextComponentTranslatable("translation.key", number);
But TextComponentTranslatable doesn't support %,d I don't know why, but somebody at mojang decided to trap this formatting and other formatting and convert it to %s
You can't even subclass TextComponentTranslatable because the network serialization is hardwired.
It might be possible to write a coremod that changes the allowable formats by changing the final variable TextComponentTranslatable.STRING_VARIABLE_PATTERN but who knows what that would break?
By adding commas ever 3 digits, the amount of energy stored in fusion reactors should become way more readable.