Repository: microsoft/PowerToys
File: src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator.UnitTest/NumberTranslatorTests.cs (C#)

Code before:
        {
            // Arrange
            var sourceCulture = new CultureInfo("en-US", false)
            {
                NumberFormat =
                {
                    NumberDecimalSeparator = decimalSeparator,
                    NumberGroupSeparator = groupSeparator,
                },
            };
            var translator = NumberTranslator.Create(sourceCulture, new CultureInfo("en-US", false));

            // Act
            var result = translator.Translate(input);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(expectedResult, result);
        }

        [DataTestMethod]
        [DataRow("de-DE", "12,0004", "12.0004")]
        [DataRow("de-DE", "0xF000", "0xF000")]
        [DataRow("de-DE", "0", "0")]
        [DataRow("de-DE", "00", "0")]
        [DataRow("de-DE", "12.0004", "120004")] // . is the group separator in de-DE
        [DataRow("de-DE", "12.04", "1204")]
        [DataRow("de-DE", "12.4", "124")]
        [DataRow("de-DE", "123.01 + 52.30", "12301 + 5230")]
        [DataRow("de-DE", "123.001 + 52.30", "123001 + 5230")]
        [DataRow("fr-FR", "0", "0")]
        [DataRow("fr-FR", "00", "0")]
        [DataRow("fr-FR", "12.0004", "12.0004")] // . is not decimal or group separator in fr-FR
        [DataRow("fr-FR", "12.04", "12.04")]
        [DataRow("fr-FR", "12.4", "12.4")]
        [DataRow("fr-FR", "123.01 + 52.30", "123.01 + 52.30")]
        [DataRow("fr-FR", "123.001 + 52.30", "123.001 + 52.30")]
        public void Translate_NoRemovalOfLeadingZeroesOnEdgeCases(string sourceCultureName, string input, string expectedResult)
        {
            // Arrange
            var translator = NumberTranslator.Create(new CultureInfo(sourceCultureName, false), new CultureInfo("en-US", false));

            // Act
            var result = translator.Translate(input);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(expectedResult, result);
        }
    }
}

Review comment (suggestion):
Thousands-groups come in sets of three. Here are 4 digits together after one separator. In practice (or in human language) this can only be read as _twelve and four millionths_ .

And (I think) would it be nice to include a larger number, meaning multiple separators. That, as both an integer and with decimals would be interesting.
Like, say, `3.141.592.653,5`

Code after:
        {
            // Arrange
            var sourceCulture = new CultureInfo("en-US", false)
            {
                NumberFormat =
                {
                    NumberDecimalSeparator = decimalSeparator,
                    NumberGroupSeparator = groupSeparator,
                },
            };
            var translator = NumberTranslator.Create(sourceCulture, new CultureInfo("en-US", false));

            // Act
            var result = translator.Translate(input);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(expectedResult, result);
        }

        [DataTestMethod]
        [DataRow("de-DE", "12,0004", "12.0004")]
        [DataRow("de-DE", "0xF000", "0xF000")]
        [DataRow("de-DE", "0", "0")]
        [DataRow("de-DE", "00", "0")]
        [DataRow("de-DE", "12.004", "12004")] // . is the group separator in de-DE
        [DataRow("de-DE", "12.04", "1204")]
        [DataRow("de-DE", "12.4", "124")]
        [DataRow("de-DE", "3.004.044.444,05", "3004044444.05")]
        [DataRow("de-DE", "123.01 + 52.30", "12301 + 5230")]
        [DataRow("de-DE", "123.001 + 52.30", "123001 + 5230")]
        [DataRow("fr-FR", "0", "0")]
        [DataRow("fr-FR", "00", "0")]
        [DataRow("fr-FR", "12.004", "12.004")] // . is not decimal or group separator in fr-FR
        [DataRow("fr-FR", "12.04", "12.04")]
        [DataRow("fr-FR", "12.4", "12.4")]
        [DataRow("fr-FR", "12.0004", "12.0004")]
        [DataRow("fr-FR", "123.01 + 52.30", "123.01 + 52.30")]
        [DataRow("fr-FR", "123.001 + 52.30", "123.001 + 52.30")]
        public void Translate_NoRemovalOfLeadingZeroesOnEdgeCases(string sourceCultureName, string input, string expectedResult)
        {
            // Arrange
            var translator = NumberTranslator.Create(new CultureInfo(sourceCultureName, false), new CultureInfo("en-US", false));

            // Act
            var result = translator.Translate(input);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(expectedResult, result);
        }