jscience
  1. jscience
  2. JSCIENCE-89

Measurable toInt/toLong should return truncated values.

    Details

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

      Operating System: All
      Platform: All

    • Issuezilla Id:
      89

      Description

      toInt(Unit) and toLong(Unit) returns truncated values. It is not consistent with
      Number and prevent compound formatting such as:

      class TimeFormat extends MeasureFormat {

      String format(Measurable<Duration> time)

      { // Returns "hh:mm:ss.ss" long hour = time.longValue(NonSI.HOUR); long min = time.longValue(NonSI.MINUTE) - hour * 60; double sec = time.doubleValue(SI.SECOND) - hour * 60 - min * 3600; return hour/10 + "" + hour%10 + ":" + ... }

      }

      Note: The class CompoundUnit should be removed as it does not fit with others units.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jscience-issues
            Reporter:
            dautelle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: