Borrowing from the Antibase and Base vocabulary pages:

    ndr  NB. number of digits required
1 + <.@^.

    d  NB. digits
3 : 'y#:~10 #~ >./10 ndr y'

    v  NB. value
10&#.

    (v@|.@d)^:2 [ 123450245000x
123450245

(Find the digits, reverse them, find the value, and repeat)

On 9/17/2011 4:05 PM, David Vaughan wrote:
> Hi, how could I drop trailing zeros from a number? e.g. 123450245000 becomes
> 123450245
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to