I need to format a double value to three decimal places to a string with length of 9 with leading spaces and no decimal separator.
My approach is this
NumberFormatInfo nfi = new NumberFormatInfo();
nfi.NumberDecimalSeparator = "a";
nfi.NumberGroupSeparator = "";
double a = 334.44554;
Console.WriteLine($"{a.ToString("####0.000", nfi).Replace("a", ""), 9}");
Is there a more elegant way to do this?