Skip to main content
Close announcements banner

Conversion from a decimal

Target data type Behavior Examples
String Returns the value as a string. 3.1415 is converted to "3.1415".
Boolean Returns false if the value is 0 and true otherwise. This conversion can cause a loss of data. 3.1415 is converted to true.
Integer Returns the integer part of the decimal number. This conversion can cause a loss of data.
  • 3.1415 is converted to 3.
  • 9.99 is converted to 9.
Double Returns the decimal value as a double. This conversion can cause a loss of data.
Information noteNote: If the decimal is too large to be represented as a double, it is converted to a negative infinity or positive infinity.
3.1415 is converted to 3.1415D.
Float Returns the decimal value as a float. This conversion can cause a loss of data.
Information noteNote: If the decimal is too large to be represented as a float, it is converted to a negative infinity or positive infinity.
3.1415 is converted to 3.1415F.
Long Returns the integer part of the decimal number as a long. This conversion can cause a loss of data.
  • 3.1415 is converted to 3L.
  • 9.99 is converted to 9L.

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!