I'm trying to convert a decimal to a string with 8 characters. It should have a leading white space if there are less than 3 digits before the decimal and always have four digits. Below is what I've tried and the results I've gotten.
decimal value=1; // What I want " 1.0000"
string str = value.tostring("###.0000"); // str ends up being "1"
str = string.Format("{0:###.0000}",1); // str ends up being "1.0000"
str = string.Format("{0,8}:###.0000",value); // str ends up being " 1"
What am I doing wrong?