/// <summary>
        ///   Creates or reuses a number formatter for the specified <see cref="Locale"/>.
        /// </summary>
        /// <param name="locale">
        ///   The locale.
        /// </param>
        /// <param name="options">
        ///   The options to apply when formating a number.
        /// </param>
        /// <returns>
        ///   The formatter that is the best for the <paramref name="locale"/>.
        /// </returns>
        public static INumberFormatter Create(Locale locale, NumberOptions options = null)
        {
            var             numberingSystem = NumberingSystem.Create(locale);
            NumberFormatter formatter;

            if (numberingSystem.IsNumeric)
            {
                formatter = new NumericFormatter
                {
                    Locale          = locale,
                    NumberingSystem = numberingSystem,
                    Symbols         = NumberSymbols.Create(locale),
                    Options         = options ?? new NumberOptions()
                };
            }

            else // Must be Algorithmic
            {
                formatter = new AlgorithmicFormatter
                {
                    Locale          = locale,
                    NumberingSystem = numberingSystem,
                    Options         = options ?? new NumberOptions()
                };
            }

            formatter.Resolve();
            return(formatter);
        }
        public void Create_From_Locale()
        {
            var locale  = Locale.Create("de");
            var symbols = NumberSymbols.Create(locale);

            Assert.AreEqual(",", symbols.CurrencyDecimal);
            Assert.AreEqual(".", symbols.CurrencyGroup);
            Assert.AreEqual(",", symbols.Decimal);
            Assert.AreEqual("E", symbols.Exponential);
            Assert.AreEqual(".", symbols.Group);
            Assert.AreEqual("∞", symbols.Infinity);
            Assert.AreEqual(";", symbols.List);
            Assert.AreEqual("-", symbols.MinusSign);
            Assert.AreEqual("NaN", symbols.NotANumber);
            Assert.AreEqual("%", symbols.PercentSign);
            Assert.AreEqual("‰", symbols.PerMille);
            Assert.AreEqual("+", symbols.PlusSign);
            Assert.AreEqual("·", symbols.SuperscriptingExponent);

            locale  = Locale.Create("de-AT");
            symbols = NumberSymbols.Create(locale);
            Assert.AreEqual(",", symbols.CurrencyDecimal);
            Assert.AreEqual(".", symbols.CurrencyGroup);
            Assert.AreEqual(",", symbols.Decimal);
            Assert.AreEqual("E", symbols.Exponential);
            Assert.AreEqual("\u00A0", symbols.Group);
            Assert.AreEqual("∞", symbols.Infinity);
            Assert.AreEqual(";", symbols.List);
            Assert.AreEqual("-", symbols.MinusSign);
            Assert.AreEqual("NaN", symbols.NotANumber);
            Assert.AreEqual("%", symbols.PercentSign);
            Assert.AreEqual("‰", symbols.PerMille);
            Assert.AreEqual("+", symbols.PlusSign);
            Assert.AreEqual("·", symbols.SuperscriptingExponent);
        }