本文整理汇总了C#中Int64.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Int64.ToString方法的具体用法?C# Int64.ToString怎么用?C# Int64.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Int64
的用法示例。
在下文中一共展示了Int64.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToString
public static string ToString(Int64 value)
{
return value.ToString();
}
示例2: ToString
///<include file='doc\XmlConvert.uex' path='docs/doc[@for="XmlConvert.ToString15"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public static string ToString(Int64 value)
{
return value.ToString(null, NumberFormatInfo.InvariantInfo);
}
示例3: VerifyCtorInt64
private static bool VerifyCtorInt64(Int64 value)
{
bool ret = true;
BigInteger bigInteger;
bigInteger = new BigInteger(value);
if (!bigInteger.Equals(value))
{
Console.WriteLine("Expected BigInteger {0} to be equal to Int64 {1}", bigInteger, value);
ret = false;
}
if (String.CompareOrdinal(value.ToString(), bigInteger.ToString()) != 0)
{
Console.WriteLine("Int64.ToString() and BigInteger.ToString() on {0} and {1} should be equal", value, bigInteger);
ret = false;
}
if (value != (Int64)bigInteger)
{
Console.WriteLine("Expected BigInteger {0} to be equal to Int64 {1}", bigInteger, value);
ret = false;
}
if (value != Int64.MaxValue)
{
if ((Int64)(value + 1) != (Int64)(bigInteger + 1))
{
Console.WriteLine("Adding 1 to both {0} and {1} should remain equal", value, bigInteger);
ret = false;
}
}
if (value != Int64.MinValue)
{
if ((Int64)(value - 1) != (Int64)(bigInteger - 1))
{
Console.WriteLine("Subtracting 1 from both {0} and {1} should remain equal", value, bigInteger);
ret = false;
}
}
Assert.True(VerifyBigintegerUsingIdentities(bigInteger, 0 == value), " Verification Failed");
return ret;
}
示例4: VerifyInt64ImplicitCastToBigInteger
private static void VerifyInt64ImplicitCastToBigInteger(Int64 value)
{
BigInteger bigInteger = value;
Assert.Equal(value, bigInteger);
Assert.Equal(value.ToString(), bigInteger.ToString());
Assert.Equal(value, (Int64)bigInteger);
if (value != Int64.MaxValue)
{
Assert.Equal((Int64)(value + 1), (Int64)(bigInteger + 1));
}
if (value != Int64.MinValue)
{
Assert.Equal((Int64)(value - 1), (Int64)(bigInteger - 1));
}
VerifyBigIntegerUsingIdentities(bigInteger, 0 == value);
}
示例5: VerifyCtorInt64
private static void VerifyCtorInt64(Int64 value)
{
BigInteger bigInteger = new BigInteger(value);
Assert.Equal(value, bigInteger);
Assert.Equal(0, String.CompareOrdinal(value.ToString(), bigInteger.ToString()));
Assert.Equal(value, (Int64)bigInteger);
if (value != Int64.MaxValue)
{
Assert.Equal((Int64)(value + 1), (Int64)(bigInteger + 1));
}
if (value != Int64.MinValue)
{
Assert.Equal((Int64)(value - 1), (Int64)(bigInteger - 1));
}
VerifyBigIntegerUsingIdentities(bigInteger, 0 == value);
}
示例6: AllPrimitivesMethod
private static string AllPrimitivesMethod(
bool boolean,
string str,
char character,
byte unsignedbyte,
sbyte signedbyte,
Int16 int16,
UInt16 uint16,
Int32 int32,
UInt32 uint32,
Int64 int64,
UInt64 uint64,
Single single,
Double dbl)
{
StringBuilder builder = new StringBuilder();
builder.Append(boolean.ToString() + ", ");
builder.Append(str + ", ");
builder.Append(character.ToString() + ", ");
builder.Append(unsignedbyte.ToString() + ", ");
builder.Append(signedbyte.ToString() + ", ");
builder.Append(int16.ToString() + ", ");
builder.Append(uint16.ToString() + ", ");
builder.Append(int32.ToString() + ", ");
builder.Append(uint32.ToString() + ", ");
builder.Append(int64.ToString() + ", ");
builder.Append(uint64.ToString() + ", ");
builder.Append(single.ToString() + ", ");
builder.Append(dbl);
return builder.ToString();
}