MVEL
  1. MVEL
  2. MVEL-262

BigDecimal does not show the correct value

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.16
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Fedora 15, JDK Oracle 1.6, BRMS 5.2
    • Number of attachments :
      0

      Description

      MVEL does not show the correct value for BigDecimal instances, like:

      BigDecimal ale = 500.01B;
      System.out.println(ale);

      The result is: 500

      BigDecimal should invoke toString, like any Java instance to show values of variables instead of .intValue().

      The same happens to show result of arithmetic operations btw BigDecimals:
      BigDecimal test = new BigDecimal("50000");
      System.out.println(test / new BigDecimal("1.13"));

      The result is:
      44247

      ... instead of 44247.78761061946902654867256637168.

      Anyway, the internal representation is correct, only the method invoked to show the values is wrong.

      The result for:
      System.out.println( (test / new BigDecimal("1.13")) == 44247.78761061946902654867256637168B)

      is true.

        Activity

        There are no entries against this issue.

          People

          • Assignee:
            Mike Brock
            Reporter:
            Alessandro Lazarotti
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: