 |
Qore Programming Language Reference Manual
0.9.4.1
|
81 string format(
int prec = 2,
string decimal_sep =
".",
string thousands_sep =
"");
208 string toBase(
int base = 10);
int prec()
Returns the precision of the current number.
Methods in this pseudo-class can be executed on arbitrary precision number values.
Definition: Pseudo_QC_Number.dox.h:5
bool val()
Returns True if the number is non-zero, False if zero.
bool nanp()
Returns True if the number is NaN (not a number)
string toBase(int base=10)
Converts the number to a different base (and returns it as a string).
int typeCode()
Returns Qore::NT_NUMBER.
bool strp()
Returns True because number values can be converted to strings.
bool infp()
Returns True if the number is infinity (+ or -)
int sign()
Returns -1 if the number is negative, 0 if it is zero, or 1 if it is positive.
bool intp()
Returns True because number values can be converted to integers.
Methods in this pseudo-class are available to be executed on any value type (even NOTHING); this is t...
Definition: Pseudo_QC_All.dox.h:5
number abs()
Returns the absolute value of the number.
const NF_Default
for the default format with a rounding heuristic to try to remove noise in insignificant digits from ...
Definition: Pseudo_QC_Number.dox.h:268
const NF_Raw
for the raw format without the noise reduction heuristic in the NF_Default format
Definition: Pseudo_QC_Number.dox.h:276
string format(string fmt)
Returns a formatted string of the number according to the format argument.
const NF_Scientific
for the scientific format (exponential notation)
Definition: Pseudo_QC_Number.dox.h:278
string toString()
Returns the string representation of the value; the default is an empty string.
number number(softnumber n)
Converts the argument to a number value.
const SNF_AllDigits
This is a special constant to be used with string number formatting pseudo-methods that take an integ...
Definition: Pseudo_QC_Number.dox.h:290
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2