if(account. > logamount.){
addActionError("Input amount beyond the original one ");
return INPUT;
}account和logamount都是字符串类型,我现在要比较数字。我想问问怎么换成数字类型比较?应该account. logamount. 什么方法?
addActionError("Input amount beyond the original one ");
return INPUT;
}account和logamount都是字符串类型,我现在要比较数字。我想问问怎么换成数字类型比较?应该account. logamount. 什么方法?
int a = Integer.parseInt(account);先转换吧,不过要确定accout是数字, 先判断下吧。
private String account;
private String logamount;
现在就要判断account,logamount。。不知道怎么转换数字进行比较。
if(account. > logamount.){
addActionError("Input amount beyond the original one ");
return INPUT;
}
里面点什么方法?还是按照楼上大哥说的先转换?
int a = "11111"+0;
String b = 11111+"";
这样也可以转换的
[/align]