Sponsored Content
Top Forums Shell Programming and Scripting PERL - rounding fractional number Post 302475375 by ganapati on Sunday 28th of November 2010 11:27:07 AM
Old 11-28-2010
Error Link needed to the perl package "Math::Round"!!

I've got it from internet and installed Round.pm module under 'lib\perl5\5.10\Math' and its working now Smilie Thanks.

Last edited by ganapati; 11-28-2010 at 01:05 PM..
 

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
SMB_TRAFFIC_ANALYZER(8) 				    System Administration tools 				   SMB_TRAFFIC_ANALYZER(8)

NAME
vfs_smb_traffic_analyzer - log Samba VFS read and write operations through a socket to a helper application SYNOPSIS
vfs objects = smb_traffic_analyzer DESCRIPTION
This VFS module is part of the samba(7) suite. The vfs_smb_traffic_analyzer VFS module logs client write and read operations on a Samba server and sends this data over a socket to a helper program, which feeds a SQL database. More information on the helper programs can be obtained from the homepage of the project at: http://holger123.wordpress.com/smb-traffic-analyzer/ vfs_smb_traffic_analyzer currently is aware of the following VFS operations: write pwrite read pread vfs_smb_traffic_analyzer sends the following data in a fixed format seperated by a comma through either an internet or a unix domain socket: BYTES|USER|DOMAIN|READ/WRITE|SHARE|FILENAME|TIMESTAMP Description of the records: o BYTES - the length in bytes of the VFS operation o USER - the user who initiated the operation o DOMAIN - the domain of the user o READ/WRITE - either "W" for a write operation or "R" for read o SHARE - the name of the share on which the VFS operation occured o FILENAME - the name of the file that was used by the VFS operation o TIMESTAMP - a timestamp, formatted as "yyyy-mm-dd hh-mm-ss.ms" indicating when the VFS operation occured This module is stackable. OPTIONS
smb_traffic_analyzer:mode = STRING If STRING matches to "unix_domain_socket", the module will use a unix domain socket located at /var/tmp/stadsocket, if STRING contains an different string or is not defined, the module will use an internet domain socket for data transfer. smb_traffic_analyzer:host = STRING The module will send the data to the system named with the hostname STRING. smb_traffic_analyzer:port = STRING The module will send the data using the TCP port given in STRING. smb_traffic_analyzer:anonymize_prefix = STRING The module will replace the user names with a prefix given by STRING and a simple hash number. smb_traffic_analyzer:total_anonymization = STRING If STRING matches to 'yes', the module will replace any user name with the string given by the option smb_traffic_analyzer:anonymize_prefix, without generating an additional hash number. This means that any transfer data will be mapped to a single user, leading to a total anonymization of user related data. EXAMPLES
The module running on share "example_share", using a unix domain socket [example_share] path = /data/example vfs objects = smb_traffic_analyzer smb_traffic_analyzer:mode = unix_domain_socket The module running on share "example_share", using an internet socket, connecting to host "examplehost" on port 3491. [example_share] path = /data/example vfs objects = smb_traffic_analyzer smb_traffic_analyzer:host = examplehost smb_traffic_analyzer:port = 3491 The module running on share "example_share", using an internet socket, connecting to host "examplehost" on port 3491, anonymizing user names with the prefix "User". [example_share] path = /data/example vfs objects = smb_traffic_analyzer smb_traffic_analyzer:host = examplehost smb_traffic_analyzer:port = 3491 smb_traffic_analyzer:anonymize_prefix = User VERSION
This man page is correct for version 3.3 of the Samba suite. AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. The original version of the VFS module and the helper tools were created by Holger Hetterich. Samba 3.5 06/18/2010 SMB_TRAFFIC_ANALYZER(8)
All times are GMT -4. The time now is 08:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy