Nikita Popov
0221b8b2ab
Add support for * width and precision in printf()
...
If * is used for width/precision in printf, then the width/precision
is provided by a printf argument instead of being part of the format
string. Semantics generally match those of printf in C.
This can be used to easily reproduce PHP's float printing behavior:
// Locale-sensitive using precision ini setting.
// Used prior to PHP 8.0.
sprintf("%.*G", (int) ini_get('precision'), $float);
// Locale-insensitive using precision ini setting.
// Used since to PHP 8.0.
sprintf("%.*H", (int) ini_get('precision'), $float);
// Locale-insensitive using serialize_precision ini setting.
// Used in serialize(), json_encode() etc.
sprintf("%.*H", (int) ini_get('serialize_precision'), $float);
Closes GH-5432.
2020-05-27 10:42:25 +02:00
..
2020-05-27 10:42:25 +02:00
2020-05-13 17:24:13 +02:00
2020-04-06 10:41:01 +02:00
2020-04-15 11:01:12 +02:00
2020-04-03 15:41:41 +02:00
2020-05-25 17:30:57 +02:00
2020-05-07 18:45:03 +02:00
2020-05-07 18:45:03 +02:00
2020-05-25 17:30:57 +02:00
2019-11-06 17:50:48 +01:00
2020-03-31 00:14:56 +02:00
2019-12-05 13:15:54 +01:00
2020-05-14 09:39:03 +02:00
2020-05-06 17:55:32 +02:00
2020-04-03 15:41:41 +02:00
2020-04-14 11:49:02 +02:00
2020-04-20 13:09:00 +02:00
2020-04-14 11:49:02 +02:00
2020-05-14 13:35:12 +02:00
2020-05-14 13:35:12 +02:00
2020-05-14 13:35:12 +02:00
2020-05-04 23:02:00 +02:00
2020-05-04 23:02:00 +02:00
2020-04-13 21:09:23 -07:00
2020-04-03 15:41:41 +02:00
2020-05-02 16:32:29 +02:00
2020-04-03 15:41:41 +02:00
2020-04-27 17:03:40 +02:00
2020-01-17 14:52:46 +01:00
2020-05-27 10:42:25 +02:00
2020-01-17 14:52:46 +01:00
2020-04-03 15:41:41 +02:00
2020-03-30 17:09:49 +02:00
2020-01-28 15:37:51 +01:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-05-15 10:14:22 +02:00
2020-05-07 15:46:08 +02:00
2020-02-24 10:20:49 +01:00
2020-04-22 20:18:19 +02:00
2019-12-24 17:09:44 +08:00
2020-03-04 12:46:06 +01:00
2020-04-03 15:41:41 +02:00
2020-04-22 20:18:19 +02:00
2019-12-30 15:28:37 +01:00
2019-12-30 17:38:10 +01:00
2020-04-03 15:41:41 +02:00
2020-04-02 14:51:14 +02:00
2020-04-20 13:09:00 +02:00
2020-02-25 10:21:31 +01:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-20 13:09:00 +02:00
2020-01-03 17:04:06 +01:00
2020-04-03 15:41:41 +02:00
2019-12-30 15:28:37 +01:00
2020-04-03 15:41:41 +02:00
2020-03-18 19:56:10 +01:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-03-18 19:56:10 +01:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-04-03 15:41:41 +02:00
2020-05-27 09:05:31 +02:00
2020-05-14 10:25:52 +02:00
2020-04-03 15:41:41 +02:00
2020-03-18 19:56:10 +01:00
2019-12-10 13:01:59 +01:00
2019-12-10 13:01:59 +01:00
2020-04-03 15:41:41 +02:00
2020-04-20 13:09:00 +02:00
2020-04-03 15:41:41 +02:00
2020-05-07 21:26:13 +02:00
2020-01-30 16:18:02 +01:00
2020-05-13 14:56:05 +02:00
2020-04-03 15:41:41 +02:00
2020-05-07 15:46:08 +02:00
2020-05-09 12:28:49 +08:00
2020-04-03 15:41:41 +02:00
2020-04-14 11:49:02 +02:00
2020-04-14 14:38:45 +02:00
2020-04-14 11:49:02 +02:00
2020-01-20 09:54:04 -05:00
2020-05-08 10:52:23 +02:00
2020-03-18 19:56:10 +01:00