Number formatting options

Published by aidanete on Fri, 10/11/2019 - 15:49
Upvotes: 3
Issue description

There is a bug with number variables when shown on strings, they get a floating-point even if I don't want to or they necessarily not need to do.  For example, I have a procedure that shows in the ingame chat a number, even if it doesn't have any decimals, it shows like that. Example

6, when shown on string, it shows as 6.0.

17, when shown on string it will show as 17.0.

This probably might be fixed in 2 ways:

1.- Changing how MCreator shows the numbers on chat, just like if there is no decimal, show directly the number or something like that.

2.- Check this ticket: https://mcreator.net/tracker/issue/50498

Issue comments

This is normal formatting of numbers in Java. This is not a bug but a feature request.

We will consider adding a number to string block with the number format specification option (optional digits, digits number, decimals number, ...).



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.