Announcement

Collapse
No announcement yet.

How to convert float to int32 value?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to convert float to int32 value?

    Hi, I would like to convert a float value to a int32 value, I tried using the function flt_FTOI but it only converts to int16, and the value that returns is incorrect. The float value is 84,289.52

    ¿How can I resolve this problem?

    Thanks!

  • #2
    Hi,

    I tried using the function flt_FTOI but it only converts to int16
    As in the description of the flt_FTOI function, it only converts floating-point numbers to 16-bit integers. There's no available function to use for the float to 32-bit integer conversion.

    You can try and make a custom function that can perform the conversion. Simply note that 32-bit integers in 4DGL are stored in 16-bit integer array with 2 elements.

    What do you plan on using the long values for?

    Best regards

    Comment


    • #3
      Why would you want to do this? As in what has the 32bit Integer 'got' that the float doesn't, if that makes sense?

      A 32 bit integer has, a lot more precision than a float, so you'd be muddying the waters somewhat in the conversion.
      Mark

      Comment

      Working...
      X