Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105138 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59203 invoked from network); 8 Apr 2019 10:54:14 -0000 Received: from unknown (HELO mail-it1-f174.google.com) (209.85.166.174) by pb1.pair.com with SMTP; 8 Apr 2019 10:54:14 -0000 Received: by mail-it1-f174.google.com with SMTP id s3so19249001itk.1 for ; Mon, 08 Apr 2019 00:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=7TgwXQRfc9jcUDvypoutAfQLESxiAIuCbEPL4mTbDtc=; b=mpWw7yS9ENxA2BRfxzRNWWDyRXk71/8ez078qi7aySWMB33g6xYlwTfSxstU6oub68 pFzYYdSHGMngZPZ6EGXDMFxpBaFD3S9GdArwMapn2u9w7vgaIx2NwdWtNW+6gGS0jS7q zjkP4Zxp2hHDxXbKyu8ruCQToIyKgaxGyv2Gztv1YqU1MEYUcFa9fqB7HOotxF7k/iOO 4f6biMgoOQIalZ5KDkhmJdNiEHt/EQh7A/HmMGXE5NvgO0Fxak0jCW7VE3QhlQSOctPp nvFGqHkFu4GV7CJmX7+gn1UaaT5bRKmJ9BxOjwaQSv0y8xC7UJS2y7NJKL76cFPjnoH5 kWXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7TgwXQRfc9jcUDvypoutAfQLESxiAIuCbEPL4mTbDtc=; b=MFHLgqP0jwnA6J6IjsoPWKXc2VuKcnUTRpn7v7UdmRpAtLsWbK54OCbEHd4Qcsm+VJ 8TcV+Sikyd3Eaw8f7APVjH7h6DLV3fEa8qzlzP/ffg+SCcCFKHbHWqLOp3W0ZN2Y0o3v wBPVOwyvi5wyB+4cYvOTRaAoxUPfTZ9jMoek4ml/oa+gd4VY4m/wLX/eHJSl1xoOGtMk eNJp/+N7X/fqygIz8iCd+AREVlgp3moxbsMw9ivxIxgj1Ki2gNTjit0Dl6yOfTA999Rx RsKx70CSj6t1Q003xxXLLx8B//Irmq5bytfzZSd19RI/qbTiNp8hUw+F1kqmtY6ivzeo S2tw== X-Gm-Message-State: APjAAAUH942JK8F8NswsaNk+O4XMBbJ6OZLMniP5Xb2xUHn9tKRD0ZkX o1Jj3JgzHfJ2+0GAqSuHwONTWRjC+TPdrZsh+PrbiwQO X-Google-Smtp-Source: APXvYqxOcusrhIeyzGJyA1t/FuQBS1dhaD2bqzKvytKul15XU8tMtuC2djlUPV0yCtln2h7An89Uj5y0+9j8xtsF2VU= X-Received: by 2002:a24:1492:: with SMTP id 140mr17818384itg.76.1554709849243; Mon, 08 Apr 2019 00:50:49 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 8 Apr 2019 04:50:38 -0300 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="0000000000004b083705860018c5" Subject: Allow number_format() have three args From: david.proweb@gmail.com (David Rodrigues) --0000000000004b083705860018c5 Content-Type: text/plain; charset="UTF-8" Currently number_format() could accept one, two or four args. If three args is passed then you will receive "wrong parameter count for number_format()" error (ArgumentCountError). It have four parameters: float $number, int $decimals, string $dec_point and string $thousands_sep. * If one arg is passed, then $decimals = 0 and $thousands_sep = ",". * If two args is passed, then $dec_point = "." and $thousands_sep = ",". * If four args is passed, then it will respect given args; There some cases where we just don't need a $thousands_sep, so I suggest to accept three args with $thousands_sep = '' (and not a comma). It will works fine for the doc ( https://www.php.net/manual/en/function.number-format.php) example: // english notation without thousands separator $english_format_number = number_format($number, 2, '.', ''); // Currently $english_format_number = number_format($number, 2, '.'); // After // 1234.57 (same result) The fourth parameter will change "the behavior" if compared with the another original cases, but it will happen because there is no reason to use three args if you pretends to keep the comma as fourth arg once that normally you will use or "." or "," as decimal separator. * If you pretends to use dot + comma, just use two args; * If you pretends to use comma + dot, just use four args; * If you pretends to use dot + nothing, use three args; * If you pretends to use comma + nothing, use three args; -- David Rodrigues --0000000000004b083705860018c5--