Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Proper creation of a negative number

by pme (Prior)
on Jul 08, 2015 at 13:40 UTC ( #1133723=note: print w/replies, xml ) Need Help??


in reply to Proper creation of a negative number

You can check the existence of minus sign and then prepend the output if necessary.
$total = sprintf("%s%.2f", @TFCNTL_Tax[$i] =~ /(\-)/ ? $1 : undef, @TF +CNTL_Tax[$i]);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1133723]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2020-01-23 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?