Package org.gdbms.engine.values

Examples of org.gdbms.engine.values.NumericValue


        } else if (f.getDriverType().equals(DECIMAL)
                || f.getDriverType().equals(NUMERIC)) {
            int scale = Integer.parseInt(f.getParams().get(SCALE));
            int precision = Integer.parseInt(f.getParams().get(PRECISION));
           
            NumericValue nv = (NumericValue) value;
            if (scale < nv.getDecimalDigitsCount()) {
                return "too many decimal digits";
            }
            if (nv.getDecimalDigitsCount() > 0) {
                /*
                 * Don't count the decimal point: length() - 1
                 */
                if (Double.toString(nv.doubleValue()).length() - 1 > precision) {
                    return "too long";
                }
            } else {
                if (Long.toString(nv.longValue()).length() > precision) {
                    return "too long";
                }
            }
           
            return null;
View Full Code Here

TOP

Related Classes of org.gdbms.engine.values.NumericValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.