Round to 4 Decimal places not working?
double dblRateEvalResult = -0.52; string strNewResult = dblRateEvalResult.ToString("000.####").TrimStart('-');
What am I doing wrong?
You need 0 custom specifier instead of #
string str = dblRateEvalResult.ToString("000.0000").TrimStart('-');
(In your code you are trying to assign string to a double value, I guess this is a typo)
If the value that is being formatted has a digit in the position where the zero appears in the format string, that digit is copied to the result string; otherwise, a zero appears in the result string.