Пример #1
0
        internal static string FormatLiteral(
            Decimal value,
            ObjectDisplayOptions options,
            CultureInfo cultureInfo = null)
        {
            string str = value.ToString(ObjectDisplay.GetFormatCulture(cultureInfo));

            if (!options.IncludesOption(ObjectDisplayOptions.IncludeTypeSuffix))
            {
                return(str);
            }
            return(str + "M");
        }
Пример #2
0
        internal static string FormatLiteral(
            ulong value,
            ObjectDisplayOptions options,
            CultureInfo cultureInfo = null)
        {
            StringBuilder builder = new StringBuilder();

            if (options.IncludesOption(ObjectDisplayOptions.UseHexadecimalNumbers))
            {
                builder.Append("0x");
                builder.Append(value.ToString("x16"));
            }
            else
            {
                builder.Append(value.ToString(ObjectDisplay.GetFormatCulture(cultureInfo)));
            }
            if (options.IncludesOption(ObjectDisplayOptions.IncludeTypeSuffix))
            {
                builder.Append("UL");
            }
            return(builder.ToString());
        }