package com.fdkankan.dxf.parse.utils;

import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DecimalCheckUtil {

    /**
     * 判断是否为数字
     *
     * @param checkStr
     * @return
     */
    public static boolean check(String checkStr) {
        if (checkStr != null && !Objects.equals("", checkStr)) {
            String regExp = "^(-?\\d+)(\\.\\d+)?$";
            Pattern pattern = Pattern.compile(regExp);
            Matcher matcher = pattern.matcher(checkStr);
            return matcher.matches();
        }
        return false;
    }
}
