Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

We have a equal opportunity Calculus class -- it's fully integrated.


devel / comp.lang.rexx / Re: Number format

SubjectAuthor
* Number formatJean-Louis Tourné
+* Re: Number formatJaime Cruz
|`- Re: Number formatJean-Louis Tourné
+- Re: Number formatGil Barmwater
`* Re: Number formatErichSt
 `- Re: Number formatJean-Louis Tourné

1
Number format

<adab609b-9598-41e3-8ff3-d1c30af2351en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=65&group=comp.lang.rexx#65

  copy link   Newsgroups: comp.lang.rexx
X-Received: by 2002:a05:6214:5f8a:b0:534:9397:5cbc with SMTP id ls10-20020a0562145f8a00b0053493975cbcmr301065qvb.81.1674037315276;
Wed, 18 Jan 2023 02:21:55 -0800 (PST)
X-Received: by 2002:a05:6808:210b:b0:367:29d:20c5 with SMTP id
r11-20020a056808210b00b00367029d20c5mr345617oiw.78.1674037314987; Wed, 18 Jan
2023 02:21:54 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.rexx
Date: Wed, 18 Jan 2023 02:21:54 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1811:3980:2000:ac20:4294:f92a:fa83;
posting-account=qTferAoAAACthXHZRZpCgofsQV-frL79
NNTP-Posting-Host: 2a02:1811:3980:2000:ac20:4294:f92a:fa83
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <adab609b-9598-41e3-8ff3-d1c30af2351en@googlegroups.com>
Subject: Number format
From: jeanlouis.tourne@gmail.com (Jean-Louis Tourné)
Injection-Date: Wed, 18 Jan 2023 10:21:55 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 4
 by: Jean-Louis Tourné - Wed, 18 Jan 2023 10:21 UTC

Hello,

How can I display (SAY) the number 123456789 under the form 123.456.789 ?

Thank you

Re: Number format

<tq8s3v$s69$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=66&group=comp.lang.rexx#66

  copy link   Newsgroups: comp.lang.rexx
Path: i2pn2.org!i2pn.org!aioe.org!6k7cqFfFHHA7nJerAAUo9Q.user.46.165.242.75.POSTED!not-for-mail
From: spammers@bite.me (Jaime Cruz)
Newsgroups: comp.lang.rexx
Subject: Re: Number format
Date: Wed, 18 Jan 2023 08:27:27 -0500
Organization: Aioe.org NNTP Server
Message-ID: <tq8s3v$s69$1@gioia.aioe.org>
References: <adab609b-9598-41e3-8ff3-d1c30af2351en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="28873"; posting-host="6k7cqFfFHHA7nJerAAUo9Q.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Jaime Cruz - Wed, 18 Jan 2023 13:27 UTC

On 1/18/23 05:21, Jean-Louis Tourné wrote:
> Hello,
>
> How can I display (SAY) the number 123456789 under the form 123.456.789 ?
>
> Thank you

/******************************* REXX *********************************/
/* REXX External Function written by Gerard Schildberger and */
/* uploaded to the comp.lang.rexx Usenet newsgroup on June 11, */
/* 2007 in response to a question from me. */
/* */
/* Arguments are: */
/* Comma(_, c, s, t) */
/* Where: */
/* _ = the input number to have commas inserted */
/* c = Character to be inserted (Default = ',') */
/* n = Number of spaces between "c" */
/* t = total insertions to perform (Default = 9999999) */
/**********************************************************************/
Parse Arg _, c, s, t

c = PickBlank(c, ',')
If \IsInt(s) | ,
s < 1 Then
s = 3

n = _ || '.9'
a = 123456789
k = 0
If \IsInt(t) Then
t = 9999999

Do j = Verify(n, a || '0', , Verify(n, a || '0.', 'M')) - s - 1 To ,
Verify(n, a, 'M') By -s While k < t
_ = Insert(c, _, j)
k = k + 1
End

Exit _

/**********************************************************************/
/* Subroutine to determine if a number is a whole number or not. */
/**********************************************************************/
IsInt:
Procedure
Return Datatype(Arg(1), 'W')

/**********************************************************************/
/* Subroutine to select the insertion character or blanks. */
/**********************************************************************/
PickBlank:
Procedure
Parse Arg x, y
Arg xu
If xu == 'BLANK' Then
Return ' '
Return Word(x y, 1)

--
Jaime A. Cruz

Nassau Wings Motorcycle Club
http://www.nassauwings.org/

Re: Number format

<878f56df-45fc-48e7-8c99-7771a89f8493n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=67&group=comp.lang.rexx#67

  copy link   Newsgroups: comp.lang.rexx
X-Received: by 2002:a05:6214:3105:b0:52a:4a2d:5e2d with SMTP id ks5-20020a056214310500b0052a4a2d5e2dmr388025qvb.44.1674062480485;
Wed, 18 Jan 2023 09:21:20 -0800 (PST)
X-Received: by 2002:a05:6870:4996:b0:151:355d:90ce with SMTP id
ho22-20020a056870499600b00151355d90cemr708186oab.16.1674062479823; Wed, 18
Jan 2023 09:21:19 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.rexx
Date: Wed, 18 Jan 2023 09:21:19 -0800 (PST)
In-Reply-To: <tq8s3v$s69$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1811:3980:2000:ac20:4294:f92a:fa83;
posting-account=qTferAoAAACthXHZRZpCgofsQV-frL79
NNTP-Posting-Host: 2a02:1811:3980:2000:ac20:4294:f92a:fa83
References: <adab609b-9598-41e3-8ff3-d1c30af2351en@googlegroups.com> <tq8s3v$s69$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <878f56df-45fc-48e7-8c99-7771a89f8493n@googlegroups.com>
Subject: Re: Number format
From: jeanlouis.tourne@gmail.com (Jean-Louis Tourné)
Injection-Date: Wed, 18 Jan 2023 17:21:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jean-Louis Tourné - Wed, 18 Jan 2023 17:21 UTC

Le mercredi 18 janvier 2023 à 14:27:29 UTC+1, Jaime Cruz a écrit :
> On 1/18/23 05:21, Jean-Louis Tourné wrote:
> > Hello,
> >
> > How can I display (SAY) the number 123456789 under the form 123.456.789 ?
> >
> > Thank you
> /******************************* REXX *********************************/
> /* REXX External Function written by Gerard Schildberger and */
> /* uploaded to the comp.lang.rexx Usenet newsgroup on June 11, */
> /* 2007 in response to a question from me. */
> /* */
> /* Arguments are: */
> /* Comma(_, c, s, t) */
> /* Where: */
> /* _ = the input number to have commas inserted */
> /* c = Character to be inserted (Default = ',') */
> /* n = Number of spaces between "c" */
> /* t = total insertions to perform (Default = 9999999) */
> /**********************************************************************/
> Parse Arg _, c, s, t
>
> c = PickBlank(c, ',')
> If \IsInt(s) | ,
> s < 1 Then
> s = 3
>
> n = _ || '.9'
> a = 123456789
> k = 0
> If \IsInt(t) Then
> t = 9999999
>
> Do j = Verify(n, a || '0', , Verify(n, a || '0.', 'M')) - s - 1 To ,
> Verify(n, a, 'M') By -s While k < t
> _ = Insert(c, _, j)
> k = k + 1
> End
>
> Exit _
>
> /**********************************************************************/
> /* Subroutine to determine if a number is a whole number or not. */
> /**********************************************************************/
> IsInt:
> Procedure
> Return Datatype(Arg(1), 'W')
>
> /**********************************************************************/
> /* Subroutine to select the insertion character or blanks. */
> /**********************************************************************/
> PickBlank:
> Procedure
> Parse Arg x, y
> Arg xu
> If xu == 'BLANK' Then
> Return ' '
> Return Word(x y, 1)
>
> --
> Jaime A. Cruz
>
> Nassau Wings Motorcycle Club
> http://www.nassauwings.org/

Thank You for this quick response. I imagined that there was maybe a rexx " FORMAT" instruction to obtain the same result.

Re: Number format

<tq9g45$oks$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=68&group=comp.lang.rexx#68

  copy link   Newsgroups: comp.lang.rexx
Path: i2pn2.org!i2pn.org!aioe.org!rIuZnwqMaGmXZ4vifsGsIg.user.46.165.242.75.POSTED!not-for-mail
From: gbarmwater@alum.rpi.edu (Gil Barmwater)
Newsgroups: comp.lang.rexx
Subject: Re: Number format
Date: Wed, 18 Jan 2023 14:08:58 -0500
Organization: Aioe.org NNTP Server
Message-ID: <tq9g45$oks$1@gioia.aioe.org>
References: <adab609b-9598-41e3-8ff3-d1c30af2351en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="25244"; posting-host="rIuZnwqMaGmXZ4vifsGsIg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Gil Barmwater - Wed, 18 Jan 2023 19:08 UTC

On 1/18/2023 5:21 AM, Jean-Louis Tourné wrote:
> Hello,
>
> How can I display (SAY) the number 123456789 under the form 123.456.789 ?
>
> Thank you

Here is another way to do it if you are using ooRexx. Note that it
assumes the input string is an integer but allows for the character to
be inserted (.) to be changed as well as the length of each sub-string (3).

if arg() > 0 then do
use arg a.1, a.2='.', a.3=3
return chunk(a.1, a.2, a.3)
end

::routine chunk public
use arg str, sep=',', size=3
if str~length > size then do
parse value str~length-size'|'str with p '|' +1 front +(p) back
str = chunk(front, sep, size)||sep||back
end
return str

--
Gil Barmwater

Re: Number format

<aa937ceb-ba08-4b15-9885-95f0df08fda3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=69&group=comp.lang.rexx#69

  copy link   Newsgroups: comp.lang.rexx
X-Received: by 2002:a05:620a:b88:b0:6fa:77c0:ea01 with SMTP id k8-20020a05620a0b8800b006fa77c0ea01mr281808qkh.537.1674121261969;
Thu, 19 Jan 2023 01:41:01 -0800 (PST)
X-Received: by 2002:aca:1312:0:b0:363:b790:7a97 with SMTP id
e18-20020aca1312000000b00363b7907a97mr669696oii.40.1674121261690; Thu, 19 Jan
2023 01:41:01 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.rexx
Date: Thu, 19 Jan 2023 01:41:01 -0800 (PST)
In-Reply-To: <adab609b-9598-41e3-8ff3-d1c30af2351en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2620:1f7:2ae7:570:0:0:2:231;
posting-account=GPhkmwoAAAAurFlzlemWLYsTwFI0rp8z
NNTP-Posting-Host: 2620:1f7:2ae7:570:0:0:2:231
References: <adab609b-9598-41e3-8ff3-d1c30af2351en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aa937ceb-ba08-4b15-9885-95f0df08fda3n@googlegroups.com>
Subject: Re: Number format
From: erich.steinboeck@gmail.com (ErichSt)
Injection-Date: Thu, 19 Jan 2023 09:41:01 +0000
Content-Type: text/plain; charset="UTF-8"
 by: ErichSt - Thu, 19 Jan 2023 09:41 UTC

> How can I display (SAY) the number 123456789 under the form 123.456.789 ?
say translate('abc.def.ghi', 123456789, 'abcdefghi')

For the general case, covering also smaller numbers, you could use
say strip(translate('abc.def.ghi', 12345~right(9), 'abcdefghi'), 'l', ' .')

Re: Number format

<0078e3ff-5bd6-4b1b-8581-e094cb9ef1a8n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=70&group=comp.lang.rexx#70

  copy link   Newsgroups: comp.lang.rexx
X-Received: by 2002:a05:622a:428c:b0:3b6:2df9:b0aa with SMTP id cr12-20020a05622a428c00b003b62df9b0aamr391464qtb.579.1674129451227;
Thu, 19 Jan 2023 03:57:31 -0800 (PST)
X-Received: by 2002:a05:6870:fc86:b0:15f:6185:e782 with SMTP id
ly6-20020a056870fc8600b0015f6185e782mr804456oab.296.1674129450900; Thu, 19
Jan 2023 03:57:30 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.rexx
Date: Thu, 19 Jan 2023 03:57:30 -0800 (PST)
In-Reply-To: <aa937ceb-ba08-4b15-9885-95f0df08fda3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a03f:c409:a300:dce6:b6e3:6eb2:e407;
posting-account=qTferAoAAACthXHZRZpCgofsQV-frL79
NNTP-Posting-Host: 2a02:a03f:c409:a300:dce6:b6e3:6eb2:e407
References: <adab609b-9598-41e3-8ff3-d1c30af2351en@googlegroups.com> <aa937ceb-ba08-4b15-9885-95f0df08fda3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0078e3ff-5bd6-4b1b-8581-e094cb9ef1a8n@googlegroups.com>
Subject: Re: Number format
From: jeanlouis.tourne@gmail.com (Jean-Louis Tourné)
Injection-Date: Thu, 19 Jan 2023 11:57:31 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1698
 by: Jean-Louis Tourné - Thu, 19 Jan 2023 11:57 UTC

Le jeudi 19 janvier 2023 à 10:41:02 UTC+1, ErichSt a écrit :
> > How can I display (SAY) the number 123456789 under the form 123.456.789 ?
> say translate('abc.def.ghi', 123456789, 'abcdefghi')
>
> For the general case, covering also smaller numbers, you could use
> say strip(translate('abc.def.ghi', 12345~right(9), 'abcdefghi'), 'l', ' .')

Thank You all

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor