string.Format ignores NumberFormatInfo?

前端 未结 1 781
旧时难觅i
旧时难觅i 2021-01-12 15:14

I output data from a process to a csv. I store intermediate results in a data class, which also has methods to output the data to a string so it can be written to a file.

1条回答
  •  长发绾君心
    2021-01-12 15:50

    You have to use the N format specifier for Format to use the NumberFormatInfo. Try this

     return string.Format(nfi, "{0:N}\t{1:N}\t{2:N}",
                Value1,
                Value2,
                Value3,
            );
    

    0 讨论(0)
提交回复
热议问题