Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24760 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23651 invoked by uid 1010); 20 Jul 2006 12:20:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23635 invoked from network); 20 Jul 2006 12:20:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2006 12:20:51 -0000 X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 69.179.208.43 msa3-mx.centurytel.net Linux 2.4/2.6 Received: from ([69.179.208.43:40244] helo=msa3-mx.centurytel.net) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 46/68-29121-1257FB44 for ; Thu, 20 Jul 2006 08:20:50 -0400 Received: from pc1 (72-161-146-40.dyn.centurytel.net [72.161.146.40]) by msa3-mx.centurytel.net (8.13.6/8.13.6) with SMTP id k6KCKkXN026802 for ; Thu, 20 Jul 2006 07:20:46 -0500 Message-ID: <018101c6abf6$ee273810$0201a8c0@pc1> To: Date: Thu, 20 Jul 2006 07:20:46 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Subject: [v][sf]printf additions (#, E, g, G) From: php_lists@realplain.com ("Matt W") Hi, I've wished there was a *printf() float specifier that wouldn't include trailing zeros/point, as simply converting to string (echo, %s, etc.) can result in scientific notation, which I *don't* want (%g in convert_to_string()). The only other way that would result in what I want is number_format() with my "no-extra-zeros option" patch. ;-) So I was originally looking for how to NOT pad %f to the specified precision, then I thought why not add more of the stuff from C? (And I see it's marked "not done" in formatted_print.c.) Can/should I go ahead and add support for the # flag/specifier, g/G, and E (the missing compliment to e)? Make everything work like C, except # used with f/F, which would mean "remove trailing 0's/point" -- as C's behavior with # and f (add point even when precision=0?) can be done in PHP. (I assume C's is for when precision is specified with * + parameter?) Thoughts? Thanks, Matt