C# StreamWriter Write(Decimal)

Description

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

Syntax

StreamWriter.Write(Decimal) has the following syntax.


public virtual void Write(
  decimal value
)

Parameters

StreamWriter.Write(Decimal) has the following parameters.

  • value - The decimal value to write.

Returns

StreamWriter.Write(Decimal) method returns

Example


using System;/*from   w ww .j  a  v  a2  s .c  o m*/
using System.IO;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        string fileName = "test.txt";

        using (StreamWriter writer = new StreamWriter(fileName))
        {
            writer.Write(1.2M);
        }
    }
}




















Home »
  C# Tutorial »
    System.IO »




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