On 11-03-24 04:53 PM, Chris Stinemetz wrote:
I would like the current output of my ternary operator: 2.44318181818182 to be rounded to 2.4.
The easiest way is to use sprintf; perl -e '$var = sprintf "%.1f", 2.44318181818182; print "$var\n";' -- Just my 0.00000002 million dollars worth, Shawn Confusion is the first step of understanding. Programming is as much about organization and communication as it is about coding. The secret to great software: Fail early & often. Eliminate software piracy: use only FLOSS. -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
