C# String API 方法详细 飞书文档
C# Tostring格式
public class StringTest : MonoBehaviour
{
int number = 2345;
void Start()
{
//string value = number.ToString("n");//2,345.00
//string value = number.ToString("c");//¥2,345.00
//string value = number.ToString("f4");//保留小数 2345.0000
//string value = number.ToString("x");//16进制 929
//string value = number.ToString("d");//2345
//string value = number.ToString("e");//2.345000e+003
//string value = number.ToString("p");//1,234,500.00%
}
}