Sponsored Content
Full Discussion: Using sed to round a number
Top Forums Shell Programming and Scripting Using sed to round a number Post 302569624 by jayan_jay on Tuesday 1st of November 2011 04:14:38 AM
Old 11-01-2011
but not in sed ..
Code:
$ echo "scale=2;1.58674/1" | bc
1.58

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to round a value

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

2. Shell Programming and Scripting

round in KSH

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

3. Shell Programming and Scripting

round a number

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

4. Shell Programming and Scripting

Round the column value :

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

5. Shell Programming and Scripting

Round with awk

Hi, I have a problem. Basically I dont know how to use awk. I have a script (below) which works fine. What I want to do is somehow "pipe" in the input say 4.5 and have it give the anwer, I dont want ot have to type it in, since it will be running in a script. Any ideas how to do this???? ... (1 Reply)
Discussion started by: AnnaLynn
1 Replies

6. Shell Programming and Scripting

it's urgent ! round number in perl scripting

my $number = 12.345673412 I need 3 digits after decimal or after dot(.) i mean , i need only 12.345 I used int(), ceil(), floor() but it gives me only 12 I need it. (10 Replies)
Discussion started by: pritish.sas
10 Replies

7. Shell Programming and Scripting

Round up the decimals

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

8. Shell Programming and Scripting

How to round up value upto 2 decimal places using sed?

Please help me in rounding up value upto 2 decimal palces using sed command #!/usr/bin/bash a=15.42 b=13.33 c=`echo $a*$b |bc -l` echo $c above code is is giving output "205.5486" but i want the output as "205.55" Thank you... (15 Replies)
Discussion started by: ranabhavish
15 Replies

9. Shell Programming and Scripting

Round off Number in File

Hi Guys, i am having a csv file where i need to round off numerical column to 2 decimal precision in specific columns. i need to ignore the first two line i.e the header columns and manipulate rest of the lines of the csv file. My columns are specific i.e i need to round off only 2nd,4th and... (13 Replies)
Discussion started by: rohit_shinez
13 Replies
ttk::scale(n)							 Tk Themed Widget						     ttk::scale(n)

__________________________________________________________________________________________________________________________________________________

NAME
ttk::scale - Create and manipulate a scale widget SYNOPSIS
ttk::scale pathName ?options...? _________________________________________________________________ DESCRIPTION
A ttk::scale widget is typically used to control the numeric value of a linked variable that varies uniformly over some range. A scale dis- plays a slider that can be moved along over a trough, with the relative position of the slider over the trough indicating the value of the variable. STANDARD OPTIONS
-class -cursor -style -takefocus See the ttk_widget manual entry for details on the standard options. WIDGET-SPECIFIC OPTIONS [-command command] Specifies the prefix of a Tcl command to invoke whenever the scale's value is changed via a widget command. The actual command consists of this option followed by a space and a real number indicating the new value of the scale. [-from from] A real value corresponding to the left or top end of the scale. [-length length] Specifies the desired long dimension of the scale in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For vertical scales this is the scale's height; for horizontal scales it is the scale's width. [-orient orient] Specifies which orientation whether the widget should be laid out horizontally or vertically. Must be either hori- zontal or vertical or an abbreviation of one of these. [-to to] Specifies a real value corresponding to the right or bottom end of the scale. This value may be either less than or greater than the from option. [-value value] Specifies the current floating-point value of the variable. [-variable variable] Specifies the name of a global variable to link to the scale. Whenever the value of the variable changes, the scale will update to reflect this value. Whenever the scale is manipulated interactively, the variable will be modified to reflect the scale's new value. WIDGET COMMAND
pathName cget option Returns the current value of the specified option; see ttk::widget(n). pathName configure ?option? ?value option value ...? Modify or query widget options; see ttk::widget(n). pathName get ?x y? Get the current value of the -value option, or the value corresponding to the coordinates x,y if they are specified. X and y are pixel coordinates relative to the scale widget origin. pathName identify x y Returns the name of the element at position x, y. See ttk::widget(n). pathName instate statespec ?script? Test the widget state; see ttk::widget(n). pathName set value Set the value of the widget (i.e. the -value option) to value. The value will be clipped to the range given by the -from and -to options. Note that setting the linked variable (i.e. the variable named in the -variable option) does not cause such clipping. pathName state ?stateSpec? Modify or query the widget state; see ttk::widget(n). INTERNAL COMMANDS
pathName coords ?value? Get the coordinates corresponding to value, or the coordinates corresponding to the current value of the -value option if value is omitted. SEE ALSO
ttk::widget(n), scale(n) KEYWORDS
scale, slider, trough, widget Tk 8.5 ttk::scale(n)
All times are GMT -4. The time now is 05:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy