php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60755 "*" modifier for sprintf
Submitted: 2012-01-14 18:34 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: dohardgopro at gmail dot com Assigned:
Status: Open Package: SPL related
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
41 + 16 = ?
Subscribe to this entry?

 
 [2012-01-14 18:34 UTC] dohardgopro at gmail dot com
Description:
------------
Hi all, I'v add support of "*" modifier for sprintf, it exist in sprintf C 
implementation (http://www.cplusplus.com/reference/clibrary/cstdio/printf/)

My patch attached

Test script:
---------------
sprintf("%.*f", 2, 2) // output "2.00"
sprintf("%.2f", 2) // output "2.00"


Patches

formatted_print (last revision 2012-01-14 18:35 UTC by dohardgopro at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 06:01:25 2019 UTC