Answers for "c# string format percentage no decimal places"

C#
1

c# format string with 2 decimals

// just two decimal places
String.Format("{0:0.00}", 123.4567);      // "123.46"
String.Format("{0:0.00}", 123.4);         // "123.40"
String.Format("{0:0.00}", 123.0);         // "123.00"
Posted by: Guest on October-14-2020
1

c# tostring decimal 2 places

decimalVar.ToString("0.00"); // returns "0.50"  when decimalVar == 0.5m
Posted by: Guest on August-29-2021

Code answers related to "c# string format percentage no decimal places"

C# Answers by Framework

Browse Popular Code Answers by Language