Package java.math

Examples of java.math.BigDecimal.floatValue()


    // SIMPLE VALUE ACCESSORS BELOW -------------------------------------------

    // numerics: fractional
    public float floatValue()
        { BigDecimal bd = bigDecimalValue(); return bd == null ? 0.0f : bd.floatValue(); }
    public double doubleValue()
        { BigDecimal bd = bigDecimalValue(); return bd == null ? 0.0 : bd.doubleValue(); }
    public BigDecimal bigDecimalValue()
        { throw new XmlValueOutOfRangeException(); }
View Full Code Here


            {
                return new Short(value.shortValue());
            }
            else if (getJavaTypeMapping().getJavaType().getName().equals(ClassNameConstants.JAVA_LANG_FLOAT))
            {
                return new Float(value.floatValue());
            }
            else if (getJavaTypeMapping().getJavaType().getName().equals(ClassNameConstants.JAVA_LANG_DOUBLE))
            {
                return new Double(value.doubleValue());
            }
View Full Code Here

                MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(gOrder));
                if (mInfo != null) {
                    BigDecimal amount = toRefund.get(refundOrderId).setScale(decimals, rounding);
                    String externalId = gOrder.getString("externalId");
                    String reason = "Item(s) Returned";
                    if (amount.floatValue() > 0) {
                        try {
                            RefundOrderRequest ror = new RefundOrderRequest(mInfo, externalId, reason, amount.floatValue(), "");
                            ror.send();
                        } catch (CheckoutException e) {
                            Debug.logError(e, module);
View Full Code Here

                    BigDecimal amount = toRefund.get(refundOrderId).setScale(decimals, rounding);
                    String externalId = gOrder.getString("externalId");
                    String reason = "Item(s) Returned";
                    if (amount.floatValue() > 0) {
                        try {
                            RefundOrderRequest ror = new RefundOrderRequest(mInfo, externalId, reason, amount.floatValue(), "");
                            ror.send();
                        } catch (CheckoutException e) {
                            Debug.logError(e, module);
                            return ServiceUtil.returnError(e.getMessage());
                        }
View Full Code Here

        * @since 2009-08-06
        */
        public float floatValue()
        {
                BigDecimal adivb  = (new BigDecimal(a)).divide(new BigDecimal(b), MathContext.DECIMAL128) ;
                return adivb.floatValue() ;
        } /* Rational.floatValue */

        /** Return a representation as BigDecimal.
        * @param mc the mathematical context which determines precision, rounding mode etc
        * @return A representation as a BigDecimal floating point number.
View Full Code Here

    // SIMPLE VALUE ACCESSORS BELOW -------------------------------------------

    // numerics: fractional
    public float floatValue()
        { BigDecimal bd = bigDecimalValue(); return bd == null ? 0.0f : bd.floatValue(); }
    public double doubleValue()
        { BigDecimal bd = bigDecimalValue(); return bd == null ? 0.0 : bd.doubleValue(); }
    public BigDecimal bigDecimalValue()
        { throw new XmlValueOutOfRangeException(); }
View Full Code Here

                        trial = new BigDecimal(s2);
                    }
                }
            }
        }
        if (trial != null && (precision==1 ? trial.floatValue() == value : trial.doubleValue() == value)) {
            return trial;
        } else {
            return initial;
        }
    }
View Full Code Here

    if (localValue == null)
      return (float)0;

    // If the BigDecimal is out of range for the float
    // then positive or negative infinity is returned.
    float value = NumberDataType.normalizeREAL(localValue.floatValue());

    return value;
  }

  /**
 
View Full Code Here

    // SIMPLE VALUE ACCESSORS BELOW -------------------------------------------

    // numerics: fractional
    public float floatValue()
        { BigDecimal bd = bigDecimalValue(); return bd == null ? 0.0f : bd.floatValue(); }
    public double doubleValue()
        { BigDecimal bd = bigDecimalValue(); return bd == null ? 0.0 : bd.doubleValue(); }
    public BigDecimal bigDecimalValue()
        { throw new XmlValueNotSupportedException(XmlErrorCodes.EXCEPTION_VALUE_NOT_SUPPORTED_S2J,
                new Object[] {getPrimitiveTypeName(), "numeric"}); }
View Full Code Here

                MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(gOrder));
                if (mInfo != null) {
                    BigDecimal amount = toRefund.get(refundOrderId).setScale(decimals, rounding);
                    String externalId = gOrder.getString("externalId");
                    String reason = "Item(s) Returned";
                    if (amount.floatValue() > 0) {
                        try {
                            RefundOrderRequest ror = new RefundOrderRequest(mInfo, externalId, reason, amount.floatValue(), "");
                            ror.send();
                        } catch (CheckoutException e) {
                            Debug.logError(e, module);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.