You can use the decimal.ToString override to specify a formatting.

decimal amount = 120.00m;
string str = amount.ToString("0.00");

This can also be used when using String.Format.

Console.WriteLine("{0:0.00}", amount); 

In the case of your first rule, it cannot be done on one line.

decimal amount = 120.00m;
string str = amount.ToString("0.00").Replace(".00", String.Empty);
Answer from Joshua on Stack Overflow
๐ŸŒ
Online String Tools
onlinestringtools.com โ€บ convert-decimal-to-string
Convert Decimal to a String โ€“ Online String Tools
Free online decimal to string converter. Just load your decimal and it will automatically get converted to a string. There are no intrusive ads, popups or nonsense, just a decimal to string converter. Load a decimal, get a string.
Discussions

c# - Converting Decimal to string with non-default format - Stack Overflow
I need to convert decimal to string, in this rulers: 120.00 - "120" 120.01 - "120.01" 120.50 - "120.50" More on stackoverflow.com
๐ŸŒ stackoverflow.com
.net - decimal to string conversion in C# - Stack Overflow
How can I convert a list of decimal values to strings such that: No decimal point is shown if the value is an integer Otherwise, the number is formatted to a minimum of two decimal places For examp... More on stackoverflow.com
๐ŸŒ stackoverflow.com
c# - Convert string to decimal, keeping fractions - Stack Overflow
I am trying to convert 1200.00 to decimal, but Decimal.Parse() removes .00. I've tried some different methods, but it always removes .00, except when I supply a fraction different than 0. string v... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Python Decimal to String - Stack Overflow
There are tons of topics on here that explain how to convert a string to a decimal, but how do I convert a decimal back to a string? Like if I did this: import decimal dec = decimal.Decimal('10.0... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Browserling
browserling.com โ€บ tools โ€บ decimal-to-text
Decimal to Text Converter - Convert Decimal to String - Online - Browserling Web Developer Tools
World's simplest online decimal to text converter for web developers and programmers. Just paste dec values (integers) in the form below, press the Convert Dec to Text button, and you'll get plain text. Press a button โ€“ get text.
๐ŸŒ
PhraseFix
phrasefix.com โ€บ tools โ€บ decimal-to-string
Decimal to String Converter - PhraseFix
Free online tool that converts decimal numbers to string. Simply enter the decimal and the online tool will convert it into text.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ dotnet โ€บ api โ€บ system.decimal.tostring
Decimal.ToString Method (System) | Microsoft Learn
In converting the numeric values to strings, the example uses the formatting conventions of the en-US culture. decimal value = 16325.62m; string specifier; // Use standard numeric format specifiers.
๐ŸŒ
Studwiz
studwiz.com โ€บ utilities โ€บ decimal-to-text
Decimal to Text - Studwiz.com
June 22, 2022 - Paste your decimal string, which can be of any length, into a decimal converter to process and convert it into English text.
Top answer
1 of 4
33

You can use the decimal.ToString override to specify a formatting.

decimal amount = 120.00m;
string str = amount.ToString("0.00");

This can also be used when using String.Format.

Console.WriteLine("{0:0.00}", amount); 

In the case of your first rule, it cannot be done on one line.

decimal amount = 120.00m;
string str = amount.ToString("0.00").Replace(".00", String.Empty);
2 of 4
8

There are different overloads for decimal.ToString based on what formatting you want.

Example

decimal d = 5.00
Console.WriteLine(d.ToString("C")); // for currency

See below for other overloads... specifier is what you put into the ToString(specifier)

MSDN Documentation on Decimal.ToString

decimal value = 16325.62m; string specifier;

// Use standard numeric format specifiers.
specifier = "G";
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
// Displays:    G: 16325.62
specifier = "C";
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
// Displays:    C: $16,325.62
specifier = "E04";
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
// Displays:    E04: 1.6326E+004
specifier = "F";
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
// Displays:    F: 16325.62
specifier = "N";
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
// Displays:    N: 16,325.62
specifier = "P";
Console.WriteLine("{0}: {1}", specifier, (value/10000).ToString(specifier));
// Displays:    P: 163.26 %

// Use custom numeric format specifiers.
specifier = "0,0.000";
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
// Displays:    0,0.000: 16,325.620
specifier = "#,#.00#;(#,#.00#)";
Console.WriteLine("{0}: {1}", specifier, (value*-1).ToString(specifier));
// Displays:    #,#.00#;(#,#.00#): (16,325.62)
Find elsewhere
๐ŸŒ
Text Compare
textcompare.io โ€บ decimal-to-text
Decimal to Text Converter Online
Decimal to Text converts decimal numbers into text characters, facilitating various applications, including data decoding and text representation.
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ how-to-convert-a-decimal-value-to-a-string-in-c-sharp
How to convert a decimal value to a string in C#
Decimal.ToString() is a method in C# that is called on decimal values. It converts a numeric value that is a decimal to a string.
๐ŸŒ
UiPath Community
forum.uipath.com โ€บ help โ€บ studio
How to convert String to Decimal ... to string again - Studio - UiPath Community Forum
March 25, 2024 - Hi to all, I have a problem managing the multiple conversion of a value, to convert to decimal, keeping the (.) decimal and the 2 decimal places, even if they are = 00 Iโ€™m working on a flow where, I collect data from a CSV and need to create an XML. I currently have a Read CSV and then an ...
๐ŸŒ
Browserling
browserling.com โ€บ tools โ€บ text-to-decimal
Text to Decimal Converter - Convert Text to Decimal String - Online - Browserling Web Developer Tools
Useful, free online tool that converts plain text to a decimal string. No ads, nonsense, or garbage, just a text to dec converter. Press a button โ€“ get the result.
๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 555997-problems-of-convert-decimal-number-to-a-string
Problems of convert decimal number to a string - MATLAB Answers - MATLAB Central
June 28, 2020 - Now I want to convert a input decimal number (maybe a input number, not known) to a string, I try to use num2str and string function, but there are some problems that I can not solve. num = [110...
๐ŸŒ
Online Text Tools
onlinetexttools.com โ€บ convert-decimal-to-text
Convert Decimal to Text โ€“ Online Text Tools
Super simple, free and fast browser-based utility for converting decimal to text. Just paste your decimal and you'll instantly get text. Textabulous!
๐ŸŒ
Phrase
phrase.com โ€บ home โ€บ resources โ€บ blog โ€บ how do i convert a decimal to a string with thousands separators?
How Do I Convert a Decimal to a String with Thousands Separators?
January 23, 2025 - As an example, 1000000.00 in French would be formatted as "1 000 000,00". Note that the space character is used for thousands sepration, and the comma for decimal separation. ๐Ÿคฟ Go deeper ยป Weโ€™ve written A Concise Guide to Number Localization which covers numeral systems and separator characters.
๐ŸŒ
Oreate AI
oreateai.com โ€บ blog โ€บ unlocking-c-decimal-to-string-beyond-the-basics โ€บ 38e38b397edb5f3bab2c7b0f75db9c21
Unlocking C# Decimal to String: Beyond the Basics - Oreate AI Blog
1 month ago - You've got this decimal type, a powerhouse for accurate calculations, but when it's time to show it to the user, it needs a friendly string face. At its core, the simplest way to convert a decimal to a string is by using the .ToString() method.