增加数据格式检验,避免设备返回错误格式造成抛错误

pull/47/head
Lawrence 2021-01-27 15:31:31 +08:00
parent 84ecc89f8a
commit c223d4e4ec
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package com.genersoft.iot.vmp.gb28181.utils;
/**
*
* @author lawrencehj
* @date 2021127
*/
public class NumericUtil {
/**
* Double
* @param str
* @return true/false
*/
public static boolean isDouble(String str) {
try {
Double num2 = Double.valueOf(str);
System.out.println("Is Number!" + num2);
return true;
} catch (Exception e) {
System.out.println("Is not Number!");
return false;
}
}
}