Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-88484

Decimal numbers are displayed using the default Locale value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 16w50a
    • Minecraft 15w37a, Minecraft 15w43c, Minecraft 15w46a, Minecraft 15w51b, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.4, Minecraft 16w21a, Minecraft 1.10, Minecraft 1.11
    • Confirmed

      The bug

      Decimal numbers are displayed by using the format(String format, Object... args) method. However this method uses the current default Locale to determine how the text needs to be formatted. This causes some inconsistency problems as for example using a computer with de (German) as default locale will always use a comma as decimal seperator regardless of the current selected in-game language. A rather problematic bug caused by this is, that for example the text fields of the customized world generation invalidate themselves as only decimal numbers with a point as decimal seperator can be parsed.

      How to reproduce (/worldborder set)

      The feedback fo the /worldborder set command uses commas as decimal mark instead of points in the default language:

      [Client thread/INFO]: [CHAT] Set world border to 10,5 blocks wide (from 10,0 blocks)
      

      How to reproduce (Customized world generation settings)

      1. Open the world generation settings of a customized world
      2. Go the fourth page (should contain text fields)
        The text fields should have commas as decimal separator in case your default locale is de
      3. Try to write something
        You are unable to write because the comma invalidates the input, only after removing it you can add numbers

      Possible fixes

      • Mapping for the chat the current in-game language to the according Locale and using for other GUIs the Locale.ENGLISH
      • For each formatting format(Locale l, String format, Object... args)
      • Locale.setDefault(Locale.US); when starting Minecraft

      Personally I would prefer the first fix. Additionally instead of formatting with the method of the String class, the DecimalFormat class could be used

            grum [Mojang] Grum (Erik Broes)
            marcono1234 Marcono1234
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: