Announcement

Collapse
No announcement yet.

float number

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

  • float number

    Hi all

    I need to display float number like "3.1416" in uOLED-32028-P1T using 4DGL.

    with regards

  • #2


    I presume the number is an integer (there are no floats in the 4DGL products).
    What is 3.1416 in its integer form?

    Comment


    • #3


      as kevin said, no floats. You can fake it by storing it as an integer (multiply by 1000, so you'd have 3141), and then storing the decimal location in another variable (here, 3). Then when you want to present to the screen, send the shifted integer and the decimal location to a print function, which first prints the 3 (3141/10^3), then the decimal point, and finally the remainder 141 (3141 - 3141/10^3)

      Comment

      Working...
      X