Horje
c# format string with 2 decimals Code Example
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"

c# format string with 2 decimals
// max. two decimal places
String.Format("{0:0.##}", 123.4567);      // "123.46"
String.Format("{0:0.##}", 123.4);         // "123.4"
String.Format("{0:0.##}", 123.0);         // "123"

c# format string with 2 decimals
// at least two digits before decimal point
String.Format("{0:00.0}", 123.4567);      // "123.5"
String.Format("{0:00.0}", 23.4567);       // "23.5"
String.Format("{0:00.0}", 3.4567);        // "03.5"
String.Format("{0:00.0}", -3.4567);       // "-03.5"





Csharp

Related
sum of two numbers in c# Code Example sum of two numbers in c# Code Example
how to make a pause feautre in unity Code Example how to make a pause feautre in unity Code Example
unity3d quaternion add 90 degrees Code Example unity3d quaternion add 90 degrees Code Example
C++ in C# Code Example C++ in C# Code Example
set ads for children admob unity Code Example set ads for children admob unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6