Next Previous Up Contents
Next: CoordsDegrees
Up: Functions
Previous: Arrays
Functions for converting between strings and numeric values.
-
toString( fpVal )
-
Turns a numeric value into a string.
- Parameters:
-
fpVal
(floating point): floating point numeric value
- Return value
-
(String): a string representation of
fpVal
-
toString( intVal )
-
Turns an integer numeric value into a string.
- Parameters:
-
intVal
(long integer): integer numeric value
- Return value
-
(String): a string representation of
intVal
-
toString( charVal )
-
Turns a single character value into a string.
- Parameters:
-
charVal
(char): character numeric value
- Return value
-
(String): a string representation of
charVal
-
toString( byteVal )
-
Turns a byte value into a string.
- Parameters:
-
byteVal
(byte): byte numeric value
- Return value
-
(String): a string representation of
byteVal
-
toString( booleanVal )
-
Turns a boolean value into a string.
- Parameters:
-
booleanVal
(boolean): boolean value (true or false)
- Return value
-
(String): a string representation of
booleanVal
("true
" or "false
")
-
toString( objVal )
-
Turns any object value into a string.
As applied to existing string values this isn't really useful,
but it means that you can apply
toString
to any object value without knowing its type
and get a useful return from it.
- Parameters:
-
objVal
(Object): non-primitive value
- Return value
-
(String): a string representation of
objVal
-
parseByte( str )
-
Attempts to interpret a string as a byte (8-bit signed integer) value.
If the input string can't be interpreted in this way, a blank
value will result.
- Parameters:
-
str
(String): string containing numeric representation
- Return value
-
(byte): byte value of
str
-
parseShort( str )
-
Attempts to interpret a string as a short (16-bit signed integer) value.
If the input string can't be interpreted in this way, a blank
value will result.
- Parameters:
-
str
(String): string containing numeric representation
- Return value
-
(short integer): byte value of
str
-
parseInt( str )
-
Attempts to interpret a string as an int (32-bit signed integer) value.
If the input string can't be interpreted in this way, a blank
value will result.
- Parameters:
-
str
(String): string containing numeric representation
- Return value
-
(integer): byte value of
str
-
parseLong( str )
-
Attempts to interpret a string as a long (64-bit signed integer) value.
If the input string can't be interpreted in this way, a blank
value will result.
- Parameters:
-
str
(String): string containing numeric representation
- Return value
-
(long integer): byte value of
str
-
parseFloat( str )
-
Attempts to interpret a string as a float (32-bit floating point) value.
If the input string can't be interpreted in this way, a blank
value will result.
- Parameters:
-
str
(String): string containing numeric representation
- Return value
-
(floating point): byte value of
str
-
parseDouble( str )
-
Attempts to interpret a string as a double (64-bit signed integer) value.
If the input string can't be interpreted in this way, a blank
value will result.
- Parameters:
-
str
(String): string containing numeric representation
- Return value
-
(floating point): byte value of
str
-
toByte( value )
-
Attempts to convert the numeric argument to a
byte (8-bit signed integer) result.
If it is out of range, a blank value will result.
- Parameters:
-
value
(floating point): numeric value for conversion
- Return value
-
(byte):
value
converted to type byte
-
toShort( value )
-
Attempts to convert the numeric argument to a
short (16-bit signed integer) result.
If it is out of range, a blank value will result.
- Parameters:
-
value
(floating point): numeric value for conversion
- Return value
-
(short integer):
value
converted to type short
-
toInteger( value )
-
Attempts to convert the numeric argument to an
int (32-bit signed integer) result.
If it is out of range, a blank value will result.
- Parameters:
-
value
(floating point): numeric value for conversion
- Return value
-
(integer):
value
converted to type int
-
toLong( value )
-
Attempts to convert the numeric argument to a
long (64-bit signed integer) result.
If it is out of range, a blank value will result.
- Parameters:
-
value
(floating point): numeric value for conversion
- Return value
-
(long integer):
value
converted to type long
-
toFloat( value )
-
Attempts to convert the numeric argument to a
float (32-bit floating point) result.
If it is out of range, a blank value will result.
- Parameters:
-
value
(floating point): numeric value for conversion
- Return value
-
(floating point):
value
converted to type float
-
toDouble( value )
-
Converts the numeric argument to a
double (64-bit signed integer) result.
- Parameters:
-
value
(floating point): numeric value for conversion
- Return value
-
(floating point):
value
converted to type double
-
toHex( value )
-
Converts the integer argument to hexadecimal form.
- Parameters:
-
value
(long integer): integer value
- Return value
-
(String): hexadecimal representation of
value
- Example:
-
fromHex( hexVal )
-
Converts a string representing a hexadecimal number to its
integer value.
- Parameters:
-
hexVal
(String): hexadecimal representation of value
- Return value
-
(integer): integer value represented by
hexVal
- Example:
Next Previous Up Contents
Next: CoordsDegrees
Up: Functions
Previous: Arrays
STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page:
http://www.starlink.ac.uk/stilts/
Author email:
m.b.taylor@bristol.ac.uk
Mailing list:
topcat-user@jiscmail.ac.uk