Hey Carlos,

Thanks for noticing these. I'll take a look.

I think cl-format has the most tests of anything in Clojure and it
still has lousy test coverage of all the cases it's supposed to cover.

Tom

On Oct 28, 4:53 pm, carlitos <carlos.un...@gmail.com> wrote:
> Hello,
>
> I've encountered a couple of issues with the cl-format function
> included in contrib.pprint
>
> (cl-format nil "~1,1$" -12.0) ;; => "12.0"  the sign is lost
>
> I think the problem is the following assignment in the dollar-float
> function
>         add-sign (and (:at params) (not (neg? arg)))     ;; wrong
> (the sign is only printed when the colon modifier is present and only
> for positive numbers)
> that should read, if I understand correctly the logic,
>         add-sign (or (:at params) (neg? arg))
>
> The second issue is not so straightforward to solve:
>
> (cl-format true "~1,1$~%" 0.001) ;; => String index out of range: -1
>
> I've tracked down the bug into the function round-str (the variable
> round-pos will be negative and this case is not handled properly), but
> I don't understand the code well enough to propose a fix.
>
> Cheers,
>
> Carlos
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to