Introduction
In this article I will going to explain what is Fixed point format specifier and how to use it in C#, This format specifier string is used to convert a number to the string into the format "-ddd.ddd", where "d" denotes the number between 0 to 9, "-" denotes the negative sign (in other words the number is negative here) and "." denotes the decimal points. The result string generated by this formatting information is affected by the NumberFormatInfo class. The namespace that we use here is System.globalization. To work with this open Visual Studio 2010 and then click "File" -> "New" -> "Project...". A window is shown; in it select Console application under visual C# and give the name of your application that you want to give then click ok.
Apply a different Fixed-Point specifier in a positive integer number.
Output
![Fixed-Point Format Specifier In C#]()
Apply a different Fixed-Point specifier in a positive Double number.
If the number is of double type then the Format-Point specifier will also round off that number and give the result with the decimal point in different formats.
Output
![Fixed-Point Format Specifier In C#]()
Apply different Fixed-Point specifier in a Negative integer number.
It's the same as the positive integer value, the difference is only the negative sign that precedes the number.
Apply different Fixed-Point specifier in a Negative Double number.
It's the same as the double integer value, the difference is only the negative sign that precedes the number.
Numbers with no decimal point
If I do not want a decimal point and all the digits after the decimal point, only the number, then for this I use the Fixed-format as "F0" as:
Output
![Fixed-Point Format Specifier In C#]()
Apply Different Culture In Fixed-Point specifier
Output
![Fixed-Point Format Specifier In C#]()
Summary
In this article, I explained how to use the Fixed-Point format specifier in C#.