Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122748 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id B5E4C1A009C for ; Tue, 26 Mar 2024 12:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1711457493; bh=xFVVSvHR87wxx+70Qnjq4dOQzPBtt+UJ5gjBkMWjBHI=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=WRV8IG29hoW6GfJJE/hfgq/2kxb6MN6Cv8D0i/jlE3bXZtijFABvROptKuD1j1e16 +eNbpD20iVpDnMsBuaGS4i8bepeWBpwf66puQdDRuLA8zbyPDv3cJIxNbb1/gwuDMh R6WDcUAD6M1wUaZXaSwP16zB1eyHNH6rVNJvRCPf23MTj+LWeABU3Y4G/cKuIfGtg5 eXHobbnYznbDHMfYm7TrXTdPqDt8d2I3A2+P69TGlWsM2DOs7VOGslH7XWIw5ARiPN MLN1rIJLJVUlx+C6IWAgWE4TTltFxSySJ5rMonXWkdsJuaXqQz4rr7NVRXwGWWkKMl H66M+xpwt1Caw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 28A1118058B for ; Tue, 26 Mar 2024 12:51:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 26 Mar 2024 12:51:28 +0000 (UTC) Received: from smtpclient.apple (unknown [117.55.37.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 10773401E7; Tue, 26 Mar 2024 21:51:01 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1711457461; bh=xFVVSvHR87wxx+70Qnjq4dOQzPBtt+UJ5gjBkMWjBHI=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=mmHc3GOIQ0beid+8OXNnyhLsL+ArpVcxlS/vP9EX9R+bGIygXkFNCeZ0TGbplhUK6 1bekJZprGzPMvpnVw1ZNudQsVIUhI9BNFVd+5A+5kl4dYT8shKhuX1Ggymkh59gkT+ y4fNHWTdZ6pSeDR3EW/fQLnXEKpmUAbyh9v4aAAE= Content-Type: text/plain; charset=utf-8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath In-Reply-To: <48be5c48dfa8ae2498d185322dd83aa3@gliadin.co.uk> Date: Tue, 26 Mar 2024 21:50:48 +0900 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <4F094EDA-5058-407D-AF39-06FD934FDE1F@sakiot.com> <38d69258-cdaf-45d3-ba52-dc1398301c8c@redmagic.org.uk> <5085240B-75B8-40B8-81B9-0E80B80B7C44@sakiot.com> <48be5c48dfa8ae2498d185322dd83aa3@gliadin.co.uk> To: Barney Laurance X-Mailer: Apple Mail (2.3731.700.6) From: saki@sakiot.com (Saki Takamachi) Hi Barney, > No, that's not quite what I meant - I meant more like the opposite: >=20 >=20 > ``` > $bcNum =3D new BcNum('1234567890123456789.23456789'); > echo $bcNum->format(8, '.', ',') // 1,234,567,890,123,456,789.23456789 > ``` >=20 >=20 > Maybe also worth providing a way to specify that all decimals should = be printed, instead of just a fixed number of decimals. Ah I see! It sounds exactly like `number_format`. Sure, this might make = sense. To me, this seems worth supporting. BTW, ``` $bcNum =3D new BcNum('1234567890123456789.23456789=E2=80=99); ``` When I saw this, I thought that the behavior when $scale is omitted is = that in addition to the option of "using the global setting value", = there is also the option of "counting the length of `$num` and storing = all `$num`=E2=80=9D. In other words, it does not use any global = settings. Which of these do you think is better? Regards. Saki=