Bernie,
> there's the fairly awful:
>
> sprintf ($amt =~ /\.\d\d\d/? "%7.3f": "%7.2f"), $amt
Woops. ^^^^^^^
I think you meant :
sprintf ($amt =~ /\.\d\d\d/? "%7.3f": "%7.2f" , $amt)
> There *must* be some really sneaky/clever way to switch the
> format from two placed to three places just when I need it....
I claim neither sneaky nor clever, but I have got a few of %'s,
sprintf's and $amt's, and that can't be bad can it?
sprintf sprintf("%%%d.%df", 7, 2+$amt=~/\...\d/), $amt
Alistair
-----------------------------------------------------------------------
Registered Office:
Marks & Spencer p.l.c
Michael House, Baker Street,
London, W1U 8EP
Registered No. 214436 in England and Wales.
Telephone (020) 7935 4422
Facsimile (020) 7487 2670
www.marksandspencer.com
Please note that electronic mail may be monitored.
This e-mail is confidential. If you received it by mistake, please let us know and
then delete it from your system; you should not copy, disclose, or distribute its
contents to anyone nor act in reliance on this e-mail, as this is prohibited and may
be unlawful.
The registered office of Marks and Spencer Financial Services PLC, Marks and Spencer
Unit Trust Management Limited, Marks and Spencer Life Assurance Limited and Marks and
Spencer Savings and Investments Limited is Kings Meadow, Chester, CH99 9FB. These
firms are authorised and regulated by the Financial Services Authority.