rounder

Round a floating point number to reformat he output string.


% rounder.sh 12.4443 2  
arg1 - floating point value
arg2 - number of decimal places to round to. 

% rounder.sh 79.2773883 3
        79.277


There is now an online help for this routine.


% rounder.sh --help
Help Information for:  rounder.sh

Usage: rounder.sh 12.4443 2 
arg1 - floating point value
arg2 - number of decimal places (1 to 5) to round to. 

I will show: /home/sco/sco/codes/bash/HELP_FILES/rounder.sh.help

Enter any key to roceed with the view of help:

rounder.sh:
  Read a floating point number and round it to up to 5 
decimal places (f12.1 to f14.5). If the number of decimal 
places is specfied as 0, then the the number is printed 
as an integer. 

Examples: 
% rounder.sh 12.345 2
         12.35

% rounder.sh 12.345 0
       12     




Back to SCO CODES page