Decimal
Convert any value into an integer.
decimal converts any value that can be converted into an integer (boolean, integer, a string containing only numeric characters or a date) into a decimal representation. An optional base parameter specifies the base to be used when converting the string. If no base parameter is given, base defaults to 10.
Usage:
value.decimal([base])
or
decimal($value[,base])
Where:
base is the base to be used when performing the conversion.
### Returns
String.
Examples
Convert a hexadecimal number into decimal notation.
set a="feff";
echo ${a.decimal(16)};
Result:
echoes 65279
See Also
hex(), octal()
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified August 31, 2024: Signed-off-by: tracyragan <[email protected]> (20379ca)