pact icon indicating copy to clipboard operation
pact copied to clipboard

int-to-str does not work for negative numbers

Open jwiegley opened this issue 3 years ago • 0 comments

This was reported on Discord by user Luzzotica:

<interactive>:1:0: Numeric.showIntAtBase: applied to negative number -31535940
When trying to call str-to-int on my number "-31535940".

Another user offered this workaround:

(defun int-to-str*(x) 
    (if (< x 0) 
         (+ "-" (int-to-str 10 (- x)) ) 
         (int-to-str 10 x))))

However, Pact should support conversion of negative numbers.

jwiegley avatar Sep 21 '22 17:09 jwiegley