Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: calc percentage

by thanos1983 (Parson)
on Mar 13, 2019 at 09:36 UTC ( [id://1231203]=note: print w/replies, xml ) Need Help??


in reply to Re^2: calc percentage
in thread calc percentage

Hello bigup401,

I do not know if you saw my updated answer but here is an example that you can use a module and it will do the calculation for you (see below):

#!/usr/bin/perl use strict; use warnings; use feature 'say'; use Math::PercentChange qw(f_percent_change); my $from = 10; my $to = 15; say f_percent_change($from, $to, "%.03f"); __END__ $ perl test.pl 50.000%

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-04-25 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found