Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to display doubles with trailing zeros in c#

int numDigitsAfterPoint = 5;
double num = 1.25d;
string result = num.ToString("0." + new string('0', numDigitsAfterPoint));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #display #doubles #trailing #zeros
ADD COMMENT
Topic
Name
7+1 =