public string ToString(string format)
        {
            MagneticFieldStrengthUnit unit;
            var paddedFormat = UnitFormatCache <MagneticFieldStrengthUnit> .GetOrCreate(format, out unit);

            if (unit != this)
            {
                return(format);
            }

            using (var builder = StringBuilderPool.Borrow())
            {
                builder.Append(paddedFormat.PrePadding);
                builder.Append(paddedFormat.Format);
                builder.Append(paddedFormat.PostPadding);
                return(builder.ToString());
            }
        }
Пример #2
0
        /// <summary>
        /// Converts the unit value of this instance to its equivalent string representation.
        /// </summary>
        /// <param name="format">The format to use when convereting</param>
        /// <returns>The string representation of the value of this instance.</returns>
        public string ToString(string format)
        {
            ElectricalConductanceUnit unit;
            var paddedFormat = UnitFormatCache <ElectricalConductanceUnit> .GetOrCreate(format, out unit);

            if (unit != this)
            {
                return(format);
            }

            using (var builder = StringBuilderPool.Borrow())
            {
                builder.Append(paddedFormat.PrePadding);
                builder.Append(paddedFormat.Format);
                builder.Append(paddedFormat.PostPadding);
                return(builder.ToString());
            }
        }
        /// <summary>
        /// Converts the unit value of this instance to its equivalent string representation.
        /// </summary>
        /// <param name="format">The format to use when convereting</param>
        /// <returns>The string representation of the value of this instance.</returns>
        public string ToString(string format)
        {
            LuminousIntensityUnit unit;
            var paddedFormat = UnitFormatCache <LuminousIntensityUnit> .GetOrCreate(format, out unit);

            if (unit != this)
            {
                return(format);
            }

            using (var builder = StringBuilderPool.Borrow())
            {
                builder.Append(paddedFormat.PrePadding);
                builder.Append(paddedFormat.Format);
                builder.Append(paddedFormat.PostPadding);
                return(builder.ToString());
            }
        }
        /// <summary>
        /// Converts the unit value of this instance to its equivalent string representation.
        /// </summary>
        /// <param name="format">The format to use when convereting</param>
        /// <returns>The string representation of the value of this instance.</returns>
        public string ToString(string format)
        {
            AngularAccelerationUnit unit;
            var paddedFormat = UnitFormatCache <AngularAccelerationUnit> .GetOrCreate(format, out unit);

            if (unit != this)
            {
                return(format);
            }

            using (var builder = StringBuilderPool.Borrow())
            {
                builder.Append(paddedFormat.PrePadding);
                builder.Append(paddedFormat.Format);
                builder.Append(paddedFormat.PostPadding);
                return(builder.ToString());
            }
        }