using System;
using System.Collections;
using System.Text;
namespace ExpresstionClass
{
public class ExpresstionClass
{
public string Expresstion;//String类型表达式
public ExpresstionClass()
{
}
public ExpresstionClass(string expresstion)
{
this.Expresstion = expresstion;
}
// 判断字符串是否为数值
public bool IsNumberExp(string str)
{
bool isnumeric = false;
byte c;
if (str == null || str.Length == 0)
return false;
System.Text.ASCIIEncoding ascii = new System.Text.ASCIIEncoding();
byte[] bytestr = ascii.GetBytes(str);
for (int i = 0; i < bytestr.Length; i++)
{
c = bytestr[i];
if ((c >= 48 && c <= 57) || c == 46)
{
isnumeric = true; ;
}
else
{
if (c == 45 && bytestr .Length > 1)
{
isnumeric = true;
}
else
{
isnumeric = false;
break;
}
}
}
return isnumeric;
}
// 基本一目计算
public double account