convert Regular decimals to Packed decimals


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting convert Regular decimals to Packed decimals
Prev   Next
# 1  
Old 09-19-2008
convert Regular decimals to Packed decimals

Hi,

I am trying to find if there is a way to convert regular decimal values to Paced decimal values. I tried to find a c program but I could get a Packed converted to regular decimal not the other way round.

If not unix please let me know if any other progrimming language I can use to do this.

Thanks.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ebcidic to ASCII (Packed decimals are there)

I have a input file which is EBCIDIC and it has packed decimals. Can anyone help me to convert EBCIDIC file to ASCII(Need to convert even Packed decimal values also to normal format) (12 Replies)
Discussion started by: Anusha_Reddy
12 Replies

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

3. UNIX for Dummies Questions & Answers

Regarding Decimals in Cshell

Hello... I am new to unix and I am wondering if in a C-shell script , Are we supposed to use only whole numbers........ for example..if a program needs to calculate the average of some numbers........ @ avg = (($1 +$2 + $3)/3)) is returning a whole number.........How can a decimal be achieved... (1 Reply)
Discussion started by: ravindra22
1 Replies

4. Shell Programming and Scripting

Decimals in TCSH

Hello, I want to run a loop with non-integer values (which I know I can't) so I've created a loop of integers and divided it by 10. However, these values are always rounded down to 1 significant figure. How do I get the script to keep and use the decimal value? My script is as follows #... (1 Reply)
Discussion started by: DFr0st
1 Replies

5. Shell Programming and Scripting

How to multiple decimals in linux

How to multiple decimals in Linux? When I do it like this i get an error message echo "$((1 * 1.1))" -bash: 1 * 1.1: syntax error in expression (error token is ".1") (4 Replies)
Discussion started by: 3junior
4 Replies

6. Shell Programming and Scripting

Bourne and decimals??

I need to get 15% of the variable exer1 to be added to other exercises so far, i've got exer1=$1 aver=`expr $exer \* .15` but i keep getting an error that an integer value was expected. Is there anyway around this? (1 Reply)
Discussion started by: kdyzsa
1 Replies

7. Shell Programming and Scripting

handle decimals

Hi All, How we can handle decimals in (Float) in UNIX. a=73 b=5 c=`expr a / b` i am getting 14 but i need full 14.6 . Can any one help me pls? (1 Reply)
Discussion started by: subin_bala
1 Replies

8. UNIX for Advanced & Expert Users

Req on how to convert hex numbers to decimals

Hi, If i have an input as c1:41 c2:0x0000.00046b3e I want to make output display as c1:41 c2:224062 . Basically convert first part 0x0000 (as hex) to decimal which is 0 and convert second part 0x00046b3e (as hex) to decimal which is 289598 and as such add both parts namely... (3 Replies)
Discussion started by: hare
3 Replies

9. UNIX for Dummies Questions & Answers

EBCDIC to ASCII conv for packed decimals.

By using dd command in Unix one can convert EBCDIC file into ASCII. It fails when it comes to having packed decimals within the EBCDIC file. The resultant of it has garbage chars. How can we have EBCDIC file convertedinto ASCII, which has packed decimal data in it? Thanks in advance. (3 Replies)
Discussion started by: videsh77
3 Replies

10. Shell Programming and Scripting

getting the average of a list of decimals.

Whats up fellas, I am new here... just wanted to see if anyone knew a way to get an avergage of a list of numbers... I am trying to use bc (number of records in file divided by sum of all records in file) but it is not giving me accurate data. IE: ... (2 Replies)
Discussion started by: djsal
2 Replies
Login or Register to Ask a Question
Format::Human::Bytes(3pm)				User Contributed Perl Documentation				 Format::Human::Bytes(3pm)

NAME
Format::Human::Bytes - Format a bytecount and make it human readable VERSION
Version 0.05 SYNOPSIS
Ever showed 12345678 bytes to the user instead of just saying 11MB? This module returns you a printable string which is more readable by humans than a simple bytecount. use Format::Human::Bytes; $readable = Format::Human::Bytes::base2($bytecount[,$decimals]); $readable = Format::Human::Bytes::base10($bytecount[,$decimals]); $readable = Format::Human::Bytes->base2($bytecount[,$decimals]); $readable = Format::Human::Bytes->base10($bytecount[,$decimals]); my $fhb = Format::Human::Bytes->new(); $readable = $fhb->base2($bytecount[,$decimals]); $readable = $fhb->base10($bytecount[,$decimals]); All functions do "intelligent" switching to the next unit, for example: 1000 => 1000B [...] 8000 => 8000B 9000 => 9kB The difference between 1000 bytes and 1500 bytes is usually bigger (for example because of a slow link) than between 95kB and 95,5kB. The same applies to 8000kB vs. 9 MB and for the other units. Depending on your usage, you may want to specify how many decimals should be shown (defaults to no decimals). FUNCTIONS
/ METHODS new my $fhb = Format::Human::Bytes->new(); Creates and returns a Format::Human::Bytes - object. base2 Callable as a function: $readable = Format::Human::Bytes::base2($bytecount[,$decimals]); Callable as a class method: $readable = Format::Human::Bytes->base2($bytecount[,$decimals]); Callable as a object method: $readable = $fhb->base2($bytecount[,$decimals]); Returns the correct readable form of the given bytecount. Correct in this case means that 1kB are 1024 Bytes which is how computers see the world. If you specify a decimal parameter, the result number will have the number of decimal numbers you specified. base10 Callable as a function: $readable = Format::Human::Bytes::base10($bytecount[,$decimals]); Callable as a class method: $readable = Format::Human::Bytes->base10($bytecount[,$decimals]); Callable as a object method: $readable = $fhb->base10($bytecount[,$decimals]); Returns the incorrect readable form of the given bytecount. Incorrect in this case means that 1kB is 1000 Bytes and 1 MB is 1000000 bytes which is how some (many) people see the world, but it's wrong for computers. If you specify a decimal parameter, the result number will have the number of decimal numbers you specified. AUTHOR
Sebastian Willing, "<sewi at cpan.org>" BUGS
Please report any bugs or feature requests to "bug-format-human-bytes at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Format-Human-Bytes>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Format::Human::Bytes You can also look for information at: o RT: CPAN's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Format-Human-Bytes> o AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Format-Human-Bytes> o CPAN Ratings <http://cpanratings.perl.org/d/Format-Human-Bytes> o Search CPAN <http://search.cpan.org/dist/Format-Human-Bytes/> HISTORY
The functions are in use since late 2003 or early 2004 but I didn't pack them for CPAN before 2009. LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself. perl v5.10.1 2010-04-08 Format::Human::Bytes(3pm)