jscience
  1. jscience
  2. JSCIENCE-171

cannot convert product unit equivalent to temperature to another temperature

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: None
    • Component/s: Physics
    • Labels:
      None

      Description

      A product unit which is equivalent to a Temperature cannot be converted to another temperature. This probably affects any product units involving "non-linear" conversion.

      Example:

      Amount original = Amount.valueOf("1 L- °F/gal");
      Unit targetUnit = SI.KELVIN;
      assertTrue(original.getUnit().isCompatible(targetUnit));
      
      try {
          Amount converted = original.to(targetUnit);
          assertEquals("0.14676225 K",
                  converted.getEstimatedValue() + " " + converted.getUnit().toString());
      } catch (ConversionException e) {
          fail(e.getMessage());
      }
      // reports: java.lang.AssertionError: °F is non-linear, cannot convert
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            ilikerobots
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: