10 More Discussions You Might Find Interesting
1. Programming
Hello,
My round and floor functions in C program behaves weird. Can someone help resolve the issue..
fprintf( fp, "ROUND TEST VARIABLE 11686776.000000 %d\n", round(11686776.000000));
fprintf( fp, "ROUND TEST VARIABLE 1168677.000000 %d\n", round(1168677.000000));
fprintf( fp, "FLOOR... (3 Replies)
Discussion started by: anijan
3 Replies
2. Shell Programming and Scripting
Hi, all
I have a field in a file looks like this(hundreds of lines):
inf
1.24101
-0.185947
-0.349179
inf
0.126597
0.240142
-0.12031And what I expect is:
inf
1.241
-0.186
-0.349
inf
0.127 (7 Replies)
Discussion started by: nengcheng
7 Replies
3. Shell Programming and Scripting
Hi All,
I would like to do the following in the shell script
561.76 to 562
I tried using this echo 'scale=0; 749 * 75 /100 ' | bc
but just returned only 561
Please help me . I appreciate your help
Thanks
rajeevm (13 Replies)
Discussion started by: rajeevm
13 Replies
4. Shell Programming and Scripting
I have a file with the following content.
> cat /tmp/internetusage.txt
6709.296322 30000 2/7/2010 0.00I am using the following awk command to calculate a percentage from field 1 and 2 from the file.
awk '{ print $1/$2*100 }' /tmp/internetusage.txt
This outputs the value "22.3643" as a... (1 Reply)
Discussion started by: jelloir
1 Replies
5. Shell Programming and Scripting
HI,
I have a script which is used to calculate the Memory & CPU utilization a server.
memx=`ssh -l siebel1 ${f} /usr/sbin/prtconf|grep -i 'Memory size'|tr -s " "|/usr/xpg4/bin/awk -F" " '{print $3 * 1024}'`
v5=`ssh -l siebel1 ${f} vmstat 1 2 | tail -1 | tr -s " " | /usr/xpg4/bin/awk -v... (3 Replies)
Discussion started by: dear_abhi2007
3 Replies
6. Shell Programming and Scripting
Hi ....
Iam having the file ....in which 3rd column is numerical having 8 decimal part... i want that to cut to 2 decimal part ...
Source File :
E100|0|19940.10104030|0|1ABC
E103|1|19942.10195849|3|0ABC
E100|0|19943.10284858|0|1ABC
I want to be ......
Reulst:
... (4 Replies)
Discussion started by: satyam_sat
4 Replies
7. Shell Programming and Scripting
Hi I want to create a list of percentages but the shell script is bugging me.
If if I want to resolve the percentage of the quota used I get 0 because the schell script rounds by default.
Example
w1=860
w2=1024
w3=$((($w1/$w2)*100))
Echo $w3 gives 0
When I divide w1 by w2 the result... (13 Replies)
Discussion started by: vanloonmichel
13 Replies
8. Shell Programming and Scripting
In a shell script - How do I round a decimal number (contained in a variable) to the nearest whole number? (2 Replies)
Discussion started by: achieve
2 Replies
9. Shell Programming and Scripting
Is there an easy way to round a number up in Korn shell?
ie. 10.4 --> 11
Thanks. (6 Replies)
Discussion started by: here2learn
6 Replies
10. UNIX for Dummies Questions & Answers
Hello,
In a unix shell script,i want to round a variabele to a nearest number
Ex: set count=104.4
How can i round that to 105.?
Thanks,
Sateesh (2 Replies)
Discussion started by: kotasateesh
2 Replies