9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How to round off a decimal number to higher whole number using ceil command in unix?
Eg. 4.41 or 4.11 or 4.51 should be rounded off to 5. (11 Replies)
Discussion started by: SanjayKumar28
11 Replies
2. Shell Programming and Scripting
Hi,
I wanted to round all the values in a column to nearest integer. I have multiple files with only two columns and I want to round values in column 2. e.g
input_file
A1 23.971578 A2 34.624976 A3 46.403446 A4 375 A5 1 A6 3 A7 ... (3 Replies)
Discussion started by: ashu0001
3 Replies
3. Shell Programming and Scripting
I have a number in a bash variable n, and want to round it to 2 decimal places. How can I do that?
n=0.0867268
Need to have
num=0.09 (1 Reply)
Discussion started by: kristinu
1 Replies
4. Shell Programming and Scripting
I have two files which have to be compared. One of them has leading & trailing zeroes in certain fields.
file1
----
John,Rambo,20100101,2119.5,3302.39,100.07,22211.0
file2
----
John,Rambo,20100101,000002119.50,0003302.39,00000.07,000022211.00
I am thinking of using diff to... (10 Replies)
Discussion started by: Sheel
10 Replies
5. Shell Programming and Scripting
Hi All,
In my script I've written like this-
c=$( expr 100 / 3);echo $c
The output coming is 33. but I want to see 33.33, decimal values too. How to get that?
Thanks,
Naresh (3 Replies)
Discussion started by: NARESH1302
3 Replies
6. Shell Programming and Scripting
I am running the following script :
cat ind_sls_extr_UX.out_sorted | while read each_rec
do
count=`echo "${each_rec}" | cut -c1-2`
if
then
final_amount=0
amount=`echo "${each_rec}" | cut -c280-287`
echo "${amount}"
final_amount=`expr ${amount} + ${amount}`
... (7 Replies)
Discussion started by: mady135
7 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I am currently using tcsh
I am trying to round a decimal number to the ten-thousandths place
For instance:
1.23456 is rounded up towards 1.2346
I am not looking for truncation, but for rounding. Anyone know how to do this with awk or expr?
Thanks (2 Replies)
Discussion started by: miniwheats
2 Replies
8. Shell Programming and Scripting
How can I evaluate a decimal value in an if statement?
echo "Enter limit:"
read limit (enter a decmal value, ie: 2.5)
decimallimit=`echo $limit+0|bc|quit`
echo $decimallimit
if
then
echo $decimallimit
else
echo "failed"
fi (4 Replies)
Discussion started by: larrys721
4 Replies
9. UNIX for Advanced & Expert Users
Hi All,
Is there any command which can convert binary decimal coded values to ascii values...
i have bcd values like below
оооооооооооо0о-- -v -
Pls suggest a way to convert this.
Thanks,
Deepti.Gaur (3 Replies)
Discussion started by: gaur.deepti
3 Replies