First of all, sorry. I am not a c# programer, but I had the same problem time ago and I found no built-in function. So I programmed my own function to do that. Here is what I did.
CString CMyDoc::RoundToNDecimals (double dValue, const int nDec)
{ double dTemp = 0, dFract = 0, dInt = 0, dRes = 0;
dTemp = dValue*pow(10,nDec);
dFract = modf (dTemp, &dInt);
if (dFract >= 0.5)
dInt++;
dRes = dInt/pow(10,nDec);
CString szResult;
szResult.Format ("%s%f", szResult, dRes);
int nLarge = szResult.GetLength ();
for (int i = 0; i < nLarge; i++)
{ nCount++;
CString cLetter = szResult.GetAt (i);
if (cLetter == ".")
{ nCount += nDec;
break;
}
}
LPTSTR pStr = szResult.GetBufferSetLength (nCount);
szResult.ReleaseBuffer ();
return szResult;
;
}
I hope it helps you
Edit: I think there is no way to put 44.600 in number format, zeros at the right in decimal numbers are not considered.
Edit_2: Best answer in required language above... forget this one