保留小数位(四舍五入) float a = 3.563262f; Debug.Log(a.ToString("我是#0.0")); 数字前面补零 int a = 9; Debug.Log(string.Format("我是{0:00}", a));