zoukankan      html  css  js  c++  java
  • 把字符串转换为Double 类型

     //把字符串转换为Double 类型
        public Double convertStringToDouble(String value){
               
               Double doubleValue = new Double("0.00");
               if(value != null && !"".equals(value))
                  doubleValue = new Double(value.replaceAll(",",""));
                  
               return doubleValue;
            }

      public Integer convertStringToInteger(String value){
               
               Integer intValue = new Integer("0");
               if(value != null && !"".equals(value))
                  intValue = new Integer(value);
                  
               return intValue;
            }
            
        //把字符串转换为Date类型    
        public Date convertStringToDate(String value){
            
              Date dateValue = null;
              
              if(value != null && !"".equals(value)){
                try{
                SimpleDateFormat   format = new SimpleDateFormat("yyyy-MM-dd");  
                dateValue = format.parse(value);
                }catch(Exception e){
                      log.error("convertStrngToDouble:日期转换错误!");
                      e.printStackTrace();
                    }
                
                }
                
              return dateValue;
            }  
       

  • 相关阅读:
    RTB业务知识2-Open-RTB全景
    常见的选择<数据源协议,委托协议>(IOS发展)
    PHP高级编程SPL
    matlab 基础知识class < superclass_name
    Codeforces Round #FF (Div. 2)
    HDU 5063 Operation the Sequence
    新版本MenuDemo——使用Duilib模拟Windows本机菜单
    Codeforces 458A Golden System
    Arcgis for Javascript实现图
    [Angular2Fire] Firebase auth (Google, Github)
  • 原文地址:https://www.cnblogs.com/curtainy/p/4078104.html
Copyright © 2011-2022 走看看