Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int-to-str does not work for negative numbers #1049

Open
jwiegley opened this issue Sep 21, 2022 · 0 comments · May be fixed by #1086
Open

int-to-str does not work for negative numbers #1049

jwiegley opened this issue Sep 21, 2022 · 0 comments · May be fixed by #1086

Comments

@jwiegley
Copy link
Contributor

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.

@imalsogreg imalsogreg linked a pull request Dec 5, 2022 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant