On Mon, 1 May 2000, Stas Bekman wrote:

> On Mon, 1 May 2000, Hughes, Ralph wrote:
> 
> > OK,
> > After further investigation, it seems that Oraperl/DBI/DBD, etc. are not at
> > fault!
> > I'm formatting the data for display using Perl formats and displaying it as
> > pre-formatted output using <pre></pre> tags.  
> 
> http://perl.apache.org/guide/porting.html#Using_format_and_write_

Ah so that's why I couldn't get it to work!!!

I was trying to solve this yesterday, and was completely bamboozled why
even the $^A and formline implementation didn't work (although I might
have been doing something wrong). Anyway, the solution I came up with was
just sprintf:

##.## becomes %2.2f
####.## becomes %4.2f

Pad all strings with (" " x 80) before using, and set their length with:

%.25s for a max 25 char string.

Or prefix the string with (" " x 80) for right-justifying.

Works like a charm.

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org

Reply via email to