Next Previous Up Contents
Next: CoordsDegrees
Up: General Functions
Previous: CoordsRadians

### B.1.13 Conversions

Functions for converting between strings and numeric values.

`toString( fpVal )`
  Turns a numeric value into a string.
  - `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.
  - `intVal` (long integer): integer numeric value
  - return value (String): a string representation of `intVal`
`toString( charVal )`
  Turns a single character value into a string.
  - `charVal` (char): character numeric value
  - return value (String): a string representation of `charVal`
`toString( byteVal )`
  Turns a byte value into a string.
  - `byteVal` (byte): byte numeric value
  - return value (String): a string representation of `byteVal`
`toString( booleanVal )`
  Turns a boolean value into a string.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `value` (long integer): integer value
  - return value (String): hexadecimal representation of `value`
`fromHex( hexVal )`
  Converts a string representing a hexadecimal number to its integer value.
  - `hexVal` (String): hexadecimal representation of value
  - return value (integer): integer value represented by `hexVal`

Next Previous Up Contents
Next: CoordsDegrees
Up: General Functions
Previous: CoordsRadians

TOPCAT - Tool for OPerations on Catalogues And Tables
Starlink User Note253
TOPCAT web page: http://www.starlink.ac.uk/topcat/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk