From c223d4e4ec4e908d12776f22f48b99ff4525aed1 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Wed, 27 Jan 2021 15:31:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=A3=80=E9=AA=8C=EF=BC=8C=E9=81=BF=E5=85=8D=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E9=80=A0=E6=88=90=E6=8A=9B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/utils/NumericUtil.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/java/com/genersoft/iot/vmp/gb28181/utils/NumericUtil.java diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/NumericUtil.java b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/NumericUtil.java new file mode 100644 index 00000000..4dc63075 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/NumericUtil.java @@ -0,0 +1,25 @@ +package com.genersoft.iot.vmp.gb28181.utils; + +/** + * 数值格式判断和处理 + * @author lawrencehj + * @date 2021年1月27日 + */ +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; + } + } +}