本文整理汇总了C#中Single.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Single.ToString方法的具体用法?C# Single.ToString怎么用?C# Single.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Single
的用法示例。
在下文中一共展示了Single.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToString
///<include file='doc\XmlConvert.uex' path='docs/doc[@for="XmlConvert.ToString9"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public static string ToString(Single value)
{
if (Single.IsNegativeInfinity(value)) return "-INF";
if (Single.IsPositiveInfinity(value)) return "INF";
if (IsNegativeZero((double)value))
{
return ("-0");
}
return value.ToString("R", NumberFormatInfo.InvariantInfo);
}
示例2: ToString
///<include file='doc\XmlConvert.uex' path='docs/doc[@for="XmlConvert.ToString9"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public static string ToString(Single value) {
if (Single.IsNegativeInfinity(value)) return "-INF";
if (Single.IsPositiveInfinity(value)) return "INF";
return value.ToString("R", NumberFormatInfo.InvariantInfo);
}
示例3: GenerateSingleFloatValue
protected virtual void GenerateSingleFloatValue (Single s)
{
output.Write (s.ToString(CultureInfo.InvariantCulture));
}
示例4: 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();
}