See the Standard and Custom Numeric Format Strings. I think you're looking for ".################"
:
.00005.ToString(".################") // returns ".00005"
It's somewhat hackish, yes, but it works, as long as you don't have more than that many places after the decimal. If you do, you might want to use a StringBuilder
to build out about 330 #
s in your string (double.Epsilon
is on the order of E-324).