Linux Calculate A Percentage Of A Number
Page 1 of 1
Linux Calculate A Percentage Of A Number
Code
- Code:
#!/bin/bash
# (c) J~Net 2018
#
#
# Usage: ./calc.sh 50
#
#
#
# 40% PMPO VAL RMS = WATTS VAL EST.
#
#
#
myvar=$1
#
if [ $# -eq 0 ]
then
echo "Enter PMPO Value To Convert To RMS"
read myvar
fi
#
#
# This returns 40% of given number!
#
calc(){
awk "BEGIN{print $*}";
}
#
#
res=$(calc $myvar/100*40)
#
#
echo "40% Of $myvar Watts PMPO Is $res" Watts RMS
Re: Linux Calculate A Percentage Of A Number
Increase number by 40%
- Code:
#!/bin/bash
# (c) J~Net 2018
# jnet.forumotion.com/t1626-linux-calculate-a-percentage-of-a-number#2502
#
# Usage: ./rms_to_pmpo.sh 5
#
# 40% PMPO VAL RMS = WATTS VAL EST.
#
myvar=$1
#
if [ $# -eq 0 ]
then
echo "Enter RMS Value To Convert To PMPO"
read myvar
fi
#
# This returns + increase of 40% of a given number!
#
calc(){
awk "BEGIN{print $*}";
}
#
#
res=$(calc $myvar*100/40)
#
#
echo "$myvar Watts RMS Is $res" Watts PMPO
Similar topics
» how to calculate percentage increase In Linux Bash
» How To Calculate Percentage Increase
» Bash Percentage Calculator For Linux
» Linux Bash 1000 Prime Number Generator
» Psychic Number Guess Game With Bash For Linux
» How To Calculate Percentage Increase
» Bash Percentage Calculator For Linux
» Linux Bash 1000 Prime Number Generator
» Psychic Number Guess Game With Bash For Linux
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum