Arc Forumnew | comments | leaders | submitlogin
1 point by CatDancer 5682 days ago | link | parent

Works fine for me in arc3:

  arc> (coerce "1.234" 'int)
  1
or did you mean to say (coerce "1.234" 'num) ?


2 points by conanite 5682 days ago | link

in arc 2,

  arc> (coerce "1.234" 'int)
  1.234
arguably, this is incorrect, because 1.234 obviously isn't an integer, so arc3 improves on this by rounding. But (coerce "1.234" 'num) isn't available (in arc 2 or 3), so there's no way to use coerce for non-integers.

-----

2 points by pg 5682 days ago | link

I added a clause so (coerce "1.234" 'num) works. Thanks.

-----

1 point by conanite 5682 days ago | link

Cool, thanks. My test scripts were unhappy.

-----