How to get floats value without including exponential notation

后端 未结 5 1087
自闭症患者
自闭症患者 2021-01-02 01:04

In C#, is it possible to perform ToString on a float and get the value without using exponentials?

For example, consider the following:

float dummy;
         


        
5条回答
  •  北海茫月
    2021-01-02 01:44

    string dum = string.Format("{0:f99}",dummy).TrimEnd('0');
    if (dum.EndsWith(",")) dum = dum.Remove(dum.Length - 1);
    

提交回复
热议问题