Thank you so much!  it worked! :)

-----Original Message-----
From: Luiz Fernando B. Ribeiro [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 04, 2001 2:44 PM
To: Carter, Pamela A.
Cc: [EMAIL PROTECTED]
Subject: Re[2]: Formatting Variables in Perl


Hi Pamela,

Reply:

CPA> Im still having trouble.  Will this work with  Print MAIL as well?

You can't use sprintf inside double quotes in print, try this:

print MAIL 'You got R$ ' . sprintf("%.2f", $valor) . 'bucks!';

or you could try to use the printf command instead of print, but the
sintax is different, take a look at the the perlfunc doc:
$ perldoc perlfunc

but this will work for you:
printf MAIL "You got R\$ %.2f",$valor;

CPA> -----Original Message-----
CPA> From: Luiz Fernando B. Ribeiro [mailto:[EMAIL PROTECTED]]
CPA> Sent: Thursday, October 04, 2001 12:34 PM
CPA> To: Carter, Pamela A.
CPA> Subject: Re: Formatting Variables in Perl


CPA> Hi Pamela,

CPA> Try this:

CPA> $value = 200;

CPA> $value_ok = sprintf("%.2f", $value);

CPA> print "R\$ $value_ok"; # gives R$ 200.00

CPA> Resposta a sua mensagem de quinta-feira, 4 de outubro de 2001:

CPA>> I am passing a variable that needs to be in currency format (with two
CPA>> decimal places).  It passes as a whole number with no decimal.  How
can
CPA> I
CPA>> format this? 

CPA>> ---------------------------------------------------------------------
CPA>> To unsubscribe, e-mail: [EMAIL PROTECTED]
CPA>> For additional commands, e-mail: [EMAIL PROTECTED]




CPA> Sem mais,

CPA> Luiz Fernando B. Ribeiro
CPA> Engenho Solu��es para a Internet
CPA> [EMAIL PROTECTED]

CPA> ---------------------------------------------------------------------
CPA> To unsubscribe, e-mail: [EMAIL PROTECTED]
CPA> For additional commands, e-mail: [EMAIL PROTECTED]




Sem mais,

Luiz Fernando B. Ribeiro
Engenho Solu��es para a Internet
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to