Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: Release 1.2
    • Fix versions: Release 1.5
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code and Test

      Description

      Carlos Ungil reports a bug in cl-format as follows (http://groups.google.com/group/clojure/browse_thread/thread/bb235ff4464aed78#):

      Hello,

      I don't know if there is a better way to file bug reports (if there is one,
      it's not easy to find).

      (use 'clojure.pprint)

      (let [x 111.11111]
      (doseq [fmt ["~3f~%" "~4f~%" "~5f~%" "~6f~%"]]
      (cl-format true fmt x)))

      ;; 111.11111
      ;; 111.11111
      ;; 111.1
      ;; 111.11

      There is clearly a problem in the first two cases, too many digits are being
      printed.

      For reference, this is what common lisp does:

      (let ((x 111.11111))
      (loop for fmt in '("3f%" "4f%" "5f%" "6f%")
      do (format t fmt x)))

      ;; 111.
      ;; 111.
      ;; 111.1
      ;; 111.11

      Cheers,

      Carlos

        Attachments

          Activity

            People

            • Assignee:
              jafingerhut Andy Fingerhut
              Reporter:
              tomfaulhaber Tom Faulhaber
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: