- Functionality
Casting can be done if you want to switch from one type to another. You can switch to either double or string types.
- Arguments
No arguments needed.
- Return
The type to which cast is intended.
- Conditions
No condition.
- Examples
(Double) '12' returns a double type with the value 12.
- Exceptions
Exceptions can appear if you want to cast to a double value from a string value and the string value contains any non-number values. E.g. this cast doesn't work : (double) '1231ewq'.