## Rounding off decimal values

Rounding off decimal values
# 1
02-19-2013
Rounding off decimal values

Hi Friends,

This is my last post for today.

My input file is

When I try using this command

This is my output

But, I want to round off the 0.5s to nearest whole number and I dont want the exponential notation. Instead, I would like to see the real number

So, my final output would be

 jacobs.smith View Public Profile for jacobs.smith Find all posts by jacobs.smith
# 2
02-19-2013
This User Gave Thanks to vgersh99 For This Post:
 vgersh99 View Public Profile for vgersh99 Find all posts by vgersh99
# 3
02-19-2013
This User Gave Thanks to Yoda For This Post:
 Yoda View Public Profile for Yoda Visit Yoda's homepage! Find all posts by Yoda

Test Your Knowledge in Computers #563
Difficulty: Medium
The comparison operators are only used for comparing numerical data types.
True or False?

## Rounding off a decimal

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.

## Rounding decimal values in a column

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 ...

## Bash Rounding to 2 decimal places

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

## Working With Values After Decimal

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...

## How to get decimal values ?

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

## How to sum up two decimal values?

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}` ...

## Rounding a decimal

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

## Evaluating Decimal values

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

## Converting Binary decimal coded values to Ascii Values

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