Functions for converting between strings and numeric values.
toString( fpVal )
fpVal
(floating point): floating point numeric valuefpVal
toString( intVal )
intVal
(long integer): integer numeric valueintVal
toString( charVal )
charVal
(char): character numeric valuecharVal
toString( byteVal )
byteVal
(byte): byte numeric valuebyteVal
toString( 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 valueobjVal
parseByte( str )
str
(String): string containing numeric representationstr
parseShort( str )
str
(String): string containing numeric representationstr
parseInt( str )
str
(String): string containing numeric representationstr
parseLong( str )
str
(String): string containing numeric representationstr
parseFloat( str )
str
(String): string containing numeric representationstr
parseDouble( str )
str
(String): string containing numeric representationstr
parseInts( 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 valuevalue
toHex(42) = "2a"
fromHex( hexVal )
hexVal
(String): hexadecimal representation of valuehexVal
fromHex("2a") = 42