Esempio n. 1
0
        /// <summary>Formats the object using the formatting arguments.</summary>
        /// <param name="formattable">
        /// The object to format.
        /// </param>
        /// <param name="arguments">
        /// The formatting arguments
        /// </param>
        /// <returns>
        /// A formatted string representing the object.
        /// </returns>
        public static string ToString(this IFormattable formattable, FormattingArguments arguments)
        {
            if (formattable == null) { return null; }

            return arguments.ToString(formattable);
        }
Esempio n. 2
0
        public void ToString_7_7Dot000()
        {
            using (new CultureInfoScope("en-GB"))
            {
                string act = new FormattingArguments("0.000").ToString((Object)7);
                string exp = "7.000";

                Assert.AreEqual(exp, act);
            }
        }