C# 百分比转数字,百分比转换为小数
static void Main(string[] args) { string percent = "25%"; double number = double.Parse(percent.Replace("%", "")) / 100; Console.WriteLine(percent + ":" + number); Console.Read(); }
C# 百分比转数字,百分比转换为小数
static void Main(string[] args) { string percent = "25%"; double number = double.Parse(percent.Replace("%", "")) / 100; Console.WriteLine(percent + ":" + number); Console.Read(); }