Re: sprintf troubles
| From: | Tom Rogers | Date: | Sat, 27 Mar 2004 03:31:30 +0000 |
| Subject: | Re: sprintf troubles | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181602@lists.php.net to get a copy of this message | ||
Hi,
Saturday, March 27, 2004, 1:31:33 AM, you wrote:
CT> Hey,
CT> Im trying to use sprintf to format a number and left pad it with spaces, but
CT> it doesnt want to add the spaces
CT> I can pad it with anyother char using sprintf("%'_8.2f, $val) which will
CT> left-pad the number with underscores
CT> Has anyone had any luck padding with spaces??
CT> or is there a better way to do this??
CT> Chris
If you are looking at it on a web page the spaces will be ignored
unless you stick it in a <pre></pre> block or convert the spaces to
&nbs;
--
regards,
Tom