class SearchUtil {

    public static Long valToLong(final String value, final int scale) {
        try {
            final BigDecimal decimal = new BigDecimal(value);
            return decimal.movePointRight(scale).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
        } catch (Exception exp) {
            // NaN
        }
        return null;
    }

}