C# StringWriter Write(Decimal)

Description

StringWriter Write(Decimal) Writes the text representation of a decimal value to the text string or stream.

Syntax

StringWriter.Write(Decimal) has the following syntax.


public virtual void Write(
  decimal value
)

Parameters

StringWriter.Write(Decimal) has the following parameters.

  • value - The decimal value to write.

Returns

StringWriter.Write(Decimal) method returns

Example


using System;// w w  w . j  a va2 s.  co  m
using System.Globalization;
using System.IO;

class StrWriter
{
    static void Main()
    {
        StringWriter strWriter = new StringWriter();

        strWriter.Write(1.2M);
        
        Console.WriteLine(strWriter.ToString());
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter