Bill Allombert on Sun, 07 Jan 2024 23:32:38 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: printf "%'d" missing in Pari/GP for printing 1000s commas
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: printf "%'d" missing in Pari/GP for printing 1000s commas
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 7 Jan 2024 23:32:32 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1704666753; c=relaxed/relaxed; bh=LSInB0cgkdY9FEycL+k9LRfIM+d7wMVYuxxrD7exiJY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=UsW6rRrD0IxtT+vnADtjjV9Mat1w83EMYn4w70G1u/yi7S0hAzkyu0Oe6JFdIDRIl/L9k/5TXUMLPC3k2TlA6anwcVVm1WfD4IRyxFmM9h7Qn82t1II4KLsZDrb1z4dAr8X/hcveGnKzDDiC7E43RfiQ4qsqVCWt/LbL0Or/tPnXlsuU+0ruimCQvyQDG1uv4MtRzj60uwClrN6nAYBG8yeKUIlPMHS4hoUkK/A1BGHnsAh1AAHAQi6/EgyY9tSN2uYjUewMPL7MKlxiKa69B1BvVu1U4DOpR4teBaID9LC9WSjShZtBxE9Bq4zrfDC5oTSjctTokVkXALiqlVoqxbALqN7JmYnTUCDamYsPgVQqK86WUQPfPo47GZNftLH/0JZQWeljfhZgCJMAq/3DEG0+mekrJHGmoxlAbIQxP5hVOAukMUfqj5GnVZY3taClvtTGC7Mp8Z//7rqJBQV0LjQWsmgA0Ooj1upACx2BQuX/ULsUBwSoWakXLLQnG4o4VJsExWXmt82fW5GLN0VPjo1jWLxBWkUnJlomVOCWxUxIDbibDEwSSvOcO4OK+WR9Y0zyNOhRv0MWIeV58NA28kEzypjVHdNc7TsSPG5jT0I1yMLDRG18cIgd66rnXhpjYmzWAV+cFDBCsLxbAhUWlREWfcmXDfl20pj2fuzF+Mc=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1704666753; cv=none; b=X5flRXwuJ2YW4WExttKTcsWQcQXUsDwILnZI+zbnGJTdmha3lXVtB18C5GCnr2rRKerFNoZd6WvfeGRY4gpnARnzAuK93FKJdZqo7ZETUc4FCaXRRz5iQWRrJg1lFc9636n7zaThHl55IcK/E7N3hO2KF1+5l1+Z5+KLHQrbtESwCDHiUzj/VX2MEaqyAV8Woz3Nykc7u9L2hD/jkSU40uDSxmeHe2IsFM9Mk56XqmD+HVQRj1Ato2YEdbUq69EXqLVUdPGE/KloVL2DGahxBigN7y7Aip2zPrskyeL+gvQ58R2UZQT6Cfr14lbavMYOlUT0yKAPYW8RP7ThnS83l8yShSVMS3Rv9AMXtLRihDoEsJiiEFgg78cUoKGQsnmkJyw+96Iw4uQ5vbrMQ2rtQfCRH2/fyLwQ7TNltRXV0ruJUQNaqG9No8OAX7MMnaUzNw8NYsbdqLqSONKPi6RvAG3LteIxqD33UyBFhlYMp1Uwq8LkmeWwdN2xfxsd+IperJBn0iN++ATdArBFSKW/snoHSopocgAm/hiHVRj6DQz0WrIh2EU4n4uLN4zlrYbmOCxozQVwzgQwo8r88Loi+N/cGXz9M0bl4jMf0hrwu2vzpwDdXRL8RUrCCzMY+B04dcTgavYZ9b30ApnJh7aQh55DFP3R0VIE/N8+fgq2hSA=
- Authentication-results: smail; arc=none
- Delivery-date: Sun, 07 Jan 2024 23:32:38 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1704666753; bh=LSInB0cgkdY9FEycL+k9LRfIM+d7wMVYuxxrD7exiJY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=bqTKbL4KshVrtpMRMJtWD/lhxmQ49/3N2O22Nm8qVZSXrnhcg3rW/4rDCLK64gjUc E3FXKZQ1EUf0Rhy+qyTJxFeSpbcKo/pu+4N29mQYV6GocI++oyGJguyFYi5wy0PZTa rdxSeQ/SgQRDT1sN0KQASTS4WQOviRlTUaiTQHDY4ASxP/uI1MtzSlk7Ax8VXByHNp zLF2U9RPIZ424eM+IpFq3oH0cfXl/4/lWaQ4u2TwYzeojZ913VMcmVQTNXbd5w/Gvw kmRfDNRui8U8nwVD4kaVnEohnWxLxi4bdRaTxk6G63phuH9VobuA+Ljvsa6pFCEwIg svwS/WXe6qFT/ae4uzWNKCyyoFPWWysMH7tyz6Klrk/ZWzK51PRm1OES+wmlV5lGmL ashPEzqlm2JBpKv2Mo7p2+rrbotXPjgQo5QaL3EUKNMgFTOgW+4ZSZhcbe1oAuwugP pTDxAvHasiGEGSAoj+EibJME1hABPuzaBpN8re6vT/rarC4YcOEGNhaJR0jLTaGLyl BBLlQlIB3xDEMuali/MwdVPy39vdh3dAYiREC1Ib3tU8rIIojScHiKnrrXGFmz2EFa OkYoYaR4V01lknYoCiBN2ZJWYZIwDRyDnFpSRUz/i1B5YnLDiJ/WKsY1ot8B+PX5pk s8GgJqZXK1M+XY/XvrRCH0/o=
- In-reply-to: <086bae28e25bc41fe3d7350e1e77b879@stamm-wilbrandt.de>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <086bae28e25bc41fe3d7350e1e77b879@stamm-wilbrandt.de>
On Sun, Jan 07, 2024 at 05:42:38PM +0100, hermann@stamm-wilbrandt.de wrote:
> In C
>
> setlocale(LC_NUMERIC, "");
> printf("%'d\n", 1123456789);
>
> outputs:
>
> 1,123,456,789
Note that this is not part of C99.
> Is there a more general solution?
You can do:
f(n)=my(V=strsplit(Str(n)));forstep(i=#V-3,1,-3,V[i]=concat(V[i],","));concat(V)
Cheers,
Bill