java数据类型转换
我从SQlite读取时间类 Data类型,怎么转换成double类型呢?
读出时间类型的格式: 2012-11-23;
我已经转换成String类型,然后再转换成double,报错误!
求大神!!!
[最优解释]
想要转换成Double型,数据必须是数字型的,不能含有非数字符号(小数点除外)。
[其他解释]
String s = "123";
double num = Double.parseDouble(s);
判断下是否为空哦
[其他解释]
2012-11-23
楼主你想转成double 这个样子是不能转的
不过楼主你想让double怎么表示时间那?
20121123.0?
[其他解释]
series.add(x,y);// 往系列中加入一个随机分布的点X,Y要为int或者Double型
DBHelper dbHelper = new DBHelper(this);数据库调用我用的是这种方法
StringBuilder selectBuilder = new StringBuilder();
selectBuilder.append("select * from ").append(DBHelper.TABLE_NAME);
// dbHelper.open();
queryAccountList = dbHelper.getQueryAccountList(selectBuilder.toString(),null);
for(Account account:queryAccountList){
System.out .println("time->"+account.getDate());
System.out .println("money->"+account.getMoney());
}