Alexandria.Engines.DarkSouls.Effect.FormatAddress C# (CSharp) Method

FormatAddress() static private method

static private FormatAddress ( int address ) : string
address int
return string
        internal static string FormatAddress(int address)
        {
            return string.Format("{0:X3}h", address);
        }

Usage Example

Example #1
0
        /// <summary>Convert just the value to a string.</summary>
        /// <returns></returns>
        public string ToStringValue()
        {
            string text;

            if (IsPointer)
            {
                text = string.Format("[{0}]", Effect.FormatAddress(intValue));
            }
            else if (IsSingle)
            {
                text = string.Format("{0}", AsSingle);
                if (!text.Contains('.') && text.IndexOf("e", StringComparison.InvariantCultureIgnoreCase) < 0)
                {
                    text += ".0";
                }
            }
            else
            {
                text = string.Format("{0}", AsInt32);
                if (AsInt32 > 15)
                {
                    text += string.Format("/{0:X}h", AsInt32);
                }
            }

            return(text);
        }