Re: printf scientific notation?

From: Date: Fri, 05 Oct 2001 05:09:02 +0000
Subject: Re: printf scientific notation?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70025@lists.php.net to get a copy of this message
You could roll your own... % and (int) / and round() are all you need. -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Bill Rausch <bill@numerical.com> Newsgroups: php.general To: <php-general@lists.php.net> Sent: Wednesday, October 03, 2001 10:40 AM Subject: printf scientific notation? > I'll try this again, with a new topic and a better description. > > Can PHP print floating point numbers using scientific notation? > (like 1.32e+5) sscanf reads them ok using %f, but I'd like to print > them with %e or %g and the printf documentation doesn't mention them. > > I've tried %e anyway and it fails to print the exponent part. > > I've looked at the source code to PHP a little but with the IFDEFs > I'm not sure which routine is actually being used. I sort of have the > impression it is just calling the C routines directly so the %e and > %g should work? > > Linux (RH 7.1), Apache (1.3.20), PHP (4.0.6) > > Thanks. > -- > Bill Rausch, Software Development, Unix, Mac, Windows > Numerical Applications, Inc. 509-943-0861 bill@numerical.com

« previous php.general (#70025) next »