string format

  • Thread starter Thread starter Dean L. Howen
  • Start date Start date
D

Dean L. Howen

dear friends,
I have a litte thing, hope you can help me.
I want to convert a decimal to a string that have user-defined separator and
full decimal digits. If we set NumberDecimalDigits = num, we could not get
all deciaml digits if the length of them > num.

decimal string
123456.987654; ==> 123,456.987654;
123456.123 ==> 123,456.123;
 
Have you tried using the "N" "Number" format?

string formatted = myDecimal.ToString("N");

?
 
yes, but it seems not to work, it still cuts decimal places down to
NumberDecimalDigits number.
It will get all decimal digits without using NumberFormatInf but there're no
NumberGroupSeparator.
 
Back
Top