Skip to main content
Close announcements banner

Conversion from a boolean

Target data type Behavior
String Returns the value as a string: true is converted to "true" and false is converted to "false".
Integer Returns 1 if the value is true and 0 if the value is false. This conversion can cause a loss of data.
Decimal Returns 1 if the value is true and 0 if the value is false. This conversion can cause a loss of data.
Double Returns 1.0D if the value is true and 0.0D if the value is false. This conversion can cause a loss of data.
Float Returns 1.0F if the value is true and 0.0F if the value is false. This conversion can cause a loss of data.
Long Returns 1L if the value is true and 0L if the value is false. This conversion can cause a loss of data.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!