Working with Bjorn's suggestion, you could do this

    (('0'#~' '&=) , (#~ ' '&~:)) 5j0 ": 0034
00034
   (('0'#~' '&=) , (#~ ' '&~:)) 5j0 ": 34
00034
   (('0'#~' '&=) , (#~ ' '&~:)) 5j0 ": 340
00340
   (('0'#~' '&=) , (#~ ' '&~:)) 5j0 ": 3040
03040

every result would be a 5 character string though.

Cheers, bob

> On Sep 23, 2016, at 1:23 PM, Björn Helgason <gos...@gmail.com> wrote:
> 
> #  6j0 ": 000345
> 6
> 
> 
> On 23 Sep 2016 20:12, "Skip Cave" <s...@caveconsulting.com> wrote:
> 
>> I have a verb that users can enter, followed by a 2-5 digit number that the
>> user enters.
>> 
>> 
>> The input is typed in as a verb followed by a number, but the number can
>> have leading zeros
>> 
>> 
>>   ": 123
>> 
>> 123
>> 
>>   #": 123
>> 
>> 3                 NB. What I would expect
>> 
>>   ": 1305610
>> 
>> 1305610
>> 
>>   #": 1305610
>> 
>> 7                 NB. Also expected
>> 
>> 
>>   ":012
>> 
>> 12
>> 
>>   #":012
>> 
>> 2                 NB. 😠  Not what I expected.
>> 
>> 
>>   ":000345
>> 
>> 345
>> 
>>   #":000345
>> 
>> 3
>> 
>> 
>>   ":00034500
>> 
>> 34500
>> 
>> #":00034500
>> 
>> 5
>> 
>> 
>> 
>> NB. 😵 It drops leading zeros instead of just converting them to text!
>> 
>> 
>> It doesn't drop internal zeros or trailing zeros, just leading zeros and
>> only zeros. Not very consistent.
>> 
>> 
>> I need to have the numeric input typed after a verb be converted to a
>> character string that is an exact copy of the input number. I could require
>> that the input be quoted, but would prefer to not have require that.
>> 
>> 
>> Skip
>> 
>> 
>> 
>> 
>> 
>> 
>> Skip Cave
>> Cave Consulting LLC
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> 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