📜  unity 将数字转换为符号 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:40.083000             🧑  作者: Mango

代码示例1
public double number = 1000;
public string numberString = $"Number: {number}";

if (mumber >= 1000) {
  var exponent = (System.Math.Floor(System.Math.Log10(System.Math.Abs(number))));
  var mantissa = (number / System.Math.Pow(10, exponent));
  numberString = $"Number: {mantissa}e{exponent}";
}
else {
  numberString - $"Number: {number}"
}