As per documentation, "g - shorter of %e and %f"
I have executed this statement:
printf("e:%1\$.3e\nf:%1\$.3f\ng:%1\$.3g", .123e2);
And this is output:
e:1.230e+1 // long value
f:12.300 // shorter value
g:12.3 // here g gives something else
Why "g"
gives something else, am I getting the docs wrong?
$ php -v
PHP 7.1.10 (cli) (built: Oct 19 2017 15:16:13) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.1, Copyright (c) 2002-2017, by Derick Rethans