Functions for converting between strings and numeric values.
toString( fpVal )
fpVal (floating point): floating point numeric valuefpValtoString( intVal )
intVal (long integer): integer numeric valueintValtoString( charVal )
charVal (char): character numeric valuecharValtoString( byteVal )
byteVal (byte): byte numeric valuebyteValtoString( booleanVal )
booleanVal (boolean): boolean value (true or false)booleanVal
("true" or "false")toString( objVal )toString
to any object value without knowing its type
and get a useful return from it.
objVal (Object): non-primitive valueobjValparseByte( str )
str (String): string containing numeric representationstrparseShort( str )
str (String): string containing numeric representationstrparseInt( str )
str (String): string containing numeric representationstrparseLong( str )
str (String): string containing numeric representationstrparseFloat( str )
str (String): string containing numeric representationstrparseDouble( str )
str (String): string containing numeric representationstrparseInts( str )The details of this function's behaviour may change in future releases.
str (String): string containing a list of integer valuesparseInts("9 8 -23") = [9, 8, -23]parseInts("tiddly-pom") = []parseDoubles( str )This function can be used as a hacky way to extract the
numeric values from an STC-S
(for instance ObsCore/EPNcore s_region) string.
The details of this function's behaviour may change in future releases.
str (String): string containing a list of floating point valuesparseDoubles("1.3, 99e1, NaN, -23")
= [1.3, 990.0, NaN, -23.0]parseDoubles("Polygon ICRS 0.8 2.1 9.0 2.1 6.2 8.6")
= [0.8, 2.1, 9.0, 2.1, 6.2, 8.6]parseDoubles("La la la") = []toByte( value )
value (floating point): numeric value for conversionvalue converted to type bytetoShort( value )
value (floating point): numeric value for conversionvalue converted to type shorttoInteger( value )
value (floating point): numeric value for conversionvalue converted to type inttoLong( value )
value (floating point): numeric value for conversionvalue converted to type longtoFloat( value )
value (floating point): numeric value for conversionvalue converted to type floattoDouble( value )
value (floating point): numeric value for conversionvalue converted to type doubletoHex( value )
value (long integer): integer valuevaluetoHex(42) = "2a"fromHex( hexVal )
hexVal (String): hexadecimal representation of valuehexValfromHex("2a") = 42