10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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?
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
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
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
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
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
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
QDoubleValidator(3qt) QDoubleValidator(3qt)
NAME
QDoubleValidator - Range checking of floating-point numbers
SYNOPSIS
#include <qvalidator.h>
Inherits QValidator.
Public Members
QDoubleValidator ( QObject * parent, const char * name = 0 )
QDoubleValidator ( double bottom, double top, int decimals, QObject * parent, const char * name = 0 )
~QDoubleValidator ()
virtual QValidator::State validate ( QString & input, int & ) const
virtual void setRange ( double minimum, double maximum, int decimals = 0 )
void setBottom ( double )
void setTop ( double )
void setDecimals ( int )
double bottom () const
double top () const
int decimals () const
Properties
double bottom - the validator's minimum acceptable value
int decimals - the validator's maximum number of digits after the decimal point
double top - the validator's maximum acceptable value
DESCRIPTION
The QDoubleValidator class provides range checking of floating-point numbers.
QDoubleValidator provides an upper bound, a lower bound and a limit on the number of digits after the decimal point. It does not provide a
fixup() function.
You can set the acceptable range in one call with setRange(), or with setBottom() and setTop(). Set the number of decimal places with
setDecimals(). The validate() function returns the validation state.
See also QIntValidator, QRegExpValidator, and Miscellaneous Classes.
MEMBER FUNCTION DOCUMENTATION
QDoubleValidator::QDoubleValidator ( QObject * parent, const char * name = 0 )
Constructs a validator object with parent parent, called name, which accepts any double.
QDoubleValidator::QDoubleValidator ( double bottom, double top, int decimals, QObject * parent, const char * name = 0 )
Constructs a validator object with parent parent, called name. This validator will accept doubles from bottom to top inclusive, with up to
decimals digits after the decimal point.
QDoubleValidator::~QDoubleValidator ()
Destroys the validator, freeing any resources used.
double QDoubleValidator::bottom () const
Returns the validator's minimum acceptable value. See the "bottom" property for details.
int QDoubleValidator::decimals () const
Returns the validator's maximum number of digits after the decimal point. See the "decimals" property for details.
void QDoubleValidator::setBottom ( double )
Sets the validator's minimum acceptable value. See the "bottom" property for details.
void QDoubleValidator::setDecimals ( int )
Sets the validator's maximum number of digits after the decimal point. See the "decimals" property for details.
void QDoubleValidator::setRange ( double minimum, double maximum, int decimals = 0 ) [virtual]
Sets the validator to accept doubles from minimum to maximum inclusive, with at most decimals digits after the decimal point.
void QDoubleValidator::setTop ( double )
Sets the validator's maximum acceptable value. See the "top" property for details.
double QDoubleValidator::top () const
Returns the validator's maximum acceptable value. See the "top" property for details.
QValidator::State QDoubleValidator::validate ( QString & input, int & ) const [virtual]
Returns Acceptable if the string input contains a double that is within the valid range and is in the correct format.
Returns Intermediate if input contains a double that is outside the range or is in the wrong format, e.g. with too many digits after the
decimal point or is empty.
Returns Invalid if the input is not a double.
Note: If the valid range consists of just positive doubles (e.g. 0.0 - 100.0) and input is a negative double then Invalid is returned.
Reimplemented from QValidator.
Property Documentation
double bottom
This property holds the validator's minimum acceptable value.
Set this property's value with setBottom() and get this property's value with bottom().
See also setRange().
int decimals
This property holds the validator's maximum number of digits after the decimal point.
Set this property's value with setDecimals() and get this property's value with decimals().
See also setRange().
double top
This property holds the validator's maximum acceptable value.
Set this property's value with setTop() and get this property's value with top().
See also setRange().
SEE ALSO
http://doc.trolltech.com/qdoublevalidator.html http://www.trolltech.com/faq/tech.html
COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license
statement.
AUTHOR
Generated automatically from the source code.
BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you.
Thank you.
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a
web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially
supported by Trolltech.
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page
(qdoublevalidator.3qt) and the Qt version (3.3.8).
Trolltech AS 2 February 2007 QDoubleValidator(3qt)