Sponsored Content
Top Forums Shell Programming and Scripting PERL - rounding fractional number Post 302473224 by ganapati on Friday 19th of November 2010 08:27:16 AM
Old 11-19-2010
Hi Pludi,

Thanks a lot for your torch light and solution.

Cheers ~~ / Mysore 101 Ganapati.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rounding off to the next whole number

Hello, I searched a lot on this Forum. Please help me with the below problem. I want to divide two numbers and the result should be the next nearest whole number. E.G. Dividing 10.8/5 ideally gives 2.16. But the result should be 3 i.e. rounded off to the next whole number. Any help will... (2 Replies)
Discussion started by: damansingh
2 Replies

2. Shell Programming and Scripting

Rounding off decimals to the nearest number in PERL

Hi Guys, I am generating a statistical report , below is the snippet of the code : Now, $nSlices stands for the time duration,meaning,the statistics will be displayed for that particular time duration. Trouble is, for certain values of $totalTime (which is the end time - start time ), i... (9 Replies)
Discussion started by: rdlover
9 Replies

3. Shell Programming and Scripting

rounding time in perl

Is there a way I can round time in perl to the nearest five minutes? For example if I have log giving the following time stamps 23,52,30 it would rounded up to 23,55,00 and 23,50,01 would be rounded to 23,50,00 (3 Replies)
Discussion started by: borderblaster
3 Replies

4. Shell Programming and Scripting

Rounding number, but....

Dear Experts, I'm trying to find a way to round a number but in this way: 14367.577 ---> 14000 I used the following to round the number to the closer integer: echo $var|awk '{print int($1+0.5)}' and also: xargs printf "%1.0f" However, they don't work for my above... (9 Replies)
Discussion started by: Gery
9 Replies

5. UNIX for Dummies Questions & Answers

Rounding up to nearest whole number

Hi all of you, Would be great if you help me with how to round up to whole number from my input values like 2.99996,2.17890,3.00002,-2.3456,-2.7890 o/p should be like 3,2,3,-2,-3 thnks in adv!!!! regards (3 Replies)
Discussion started by: Indra2011
3 Replies

6. Shell Programming and Scripting

Using Fractional Numbers in Shell Variables

Hello everyone, Before I state my problem I would like to inform you that this is not an assignment. I'm just trying to learn some shell programming in my free time. I'm trying to write a parking fee calculator. But I don't seem to be able to use fractional numbers. Could you please advice... (6 Replies)
Discussion started by: iwant2learn
6 Replies

7. Shell Programming and Scripting

Perl : print the sequence number without missing number

Dear Perl users, I need your help to solve my problem below. I want to print the sequence number without missing number within the range. E.g. my sequence number : 1 2 3 4 5 6 7 8 11 12 13 14 my desired output: 1 -8 , 11-14 my code below but still problem with the result: 1 - 14 1 -... (2 Replies)
Discussion started by: mandai
2 Replies

8. Shell Programming and Scripting

printf (awk,perl,shell) float rounding issue

Hi guys, could someone throw some light on the following behaviour of printf (I'll start with info about the system and the tool/shell/interpreter versions)?: $ uname -a Linux linux-86if.site 3.1.0-1.2-desktop #1 SMP PREEMPT Thu Nov 3 14:45:45 UTC 2011 (187dde0) x86_64 x86_64 x86_64... (9 Replies)
Discussion started by: elixir_sinari
9 Replies

9. Shell Programming and Scripting

Rounding off to the nearest floating number

I have a number, which I want to convert into the nearest floating number upto two places after the decimal point. E.g. 1.2346 will become 1.23 but 1.2356 will become 1.24 . Similarly 0.009 will be 0.01 and 0.001 will be 0.00 or 0.0 (not 0, wnat to keep the decimal... (1 Reply)
Discussion started by: hbar
1 Replies

10. Shell Programming and Scripting

[awk] rounding a float number?

Heyas Trying to calculate the total size of a file by reading its bitrate. Code snippet: fs_expected() { # # Returns the expected filesize in bytes # pr_str() { ff=$(cat $TMP.info) d="${ff#*bitrate: }" echo "${d%%,*}" | $AWK '{print $1}' | head -n 1 } t_BYTERATE=$((... (9 Replies)
Discussion started by: sea
9 Replies
SoXtDirectionalLightEditor(3IV)()										 SoXtDirectionalLightEditor(3IV)()

NAME
SoXtDirectionalLightEditor -- component for editing directional lights INHERITS FROM
SoXtComponent > SoXtDirectionalLightEditor SYNOPSIS
#include <Inventor/Xt/SoXtDirectionalLightEditor.h> typedef void SoXtDirectionalLightEditorCB(void *userData, const SoDirectionalLight *light) Methods from class SoXtDirectionalLightEditor: SoXtDirectionalLightEditor(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE) ~SoXtDirectionalLightEditor() void attach(SoPath *pathToLight) void detach() SbBool isAttached() void addLightChangedCallback(SoXtDirectionalLightEditorCB *f, void *userData = NULL) void removeLightChangedCallback(SoXtDirectionalLightEditorCB *f, void *userData = NULL) void setLight(const SoDirectionalLight &newLight) const SoDirectionalLight & getLight() const Methods from class SoXtComponent: virtual void show() virtual void hide() SbBool isVisible() Widget getWidget() const SbBool isTopLevelShell() const Widget getShellWidget() const Widget getParentWidget() const void setSize(const SbVec2s &size) SbVec2s getSize() Display * getDisplay() void setTitle(const char *newTitle) const char * getTitle() const void setIconTitle(const char *newIconTitle) const char * getIconTitle() const void setWindowCloseCallback(SoXtComponentCB *func, void *data = NULL) static SoXtComponent * getComponent(Widget w) const char * getWidgetName() const const char * getClassName() const DESCRIPTION
This class is used to edit an SoDirectionalLight node (color, intensity, and direction are changed). In addition to directly editing direc- tional light nodes, the editor can also be used with callbacks which will be called whenever the light is changed. The component consists of a render area and a value slider in the main window, with controls to display a color picker. In the render area there appears a sphere representing the world, and a directional light manipulator representing the direction of the light. Picking on the manipulator and moving the mouse provides direct manipulation of the light direction. The color picker is used to edit the color, and the value slider edits the intensity. The editor can currently be attached to only one light at a time. Attaching to two different lights will automatically detach the first one before attaching the second. METHODS
SoXtDirectionalLightEditor(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE) ~SoXtDirectionalLightEditor() Constructor and destructor. void attach(SoPath *pathToLight) void detach() Attach/detach the editor to/from a directional light. When attached, changes made in the editor directly affect the attached light. SbBool isAttached() Returns TRUE if the editor is attached. void addLightChangedCallback(SoXtDirectionalLightEditorCB *f, void *userData = NULL) void removeLightChangedCallback(SoXtDirectionalLightEditorCB *f, void *userData = NULL) Additional way of using the directional light editor, by registering a callback and setting the light. void setLight(const SoDirectionalLight &newLight) const SoDirectionalLight & getLight() const Set new light values, and get the current light values. SEE ALSO
SoXtComponent, SoDirectionalLight SoXtDirectionalLightEditor(3IV)()
All times are GMT -4. The time now is 06:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy