This is all you need:

  intPart =integer(myFloat - .5)
  floatPart =myFloat - intPart

- Tab


At 10:32 PM 9/1/04, John Waller wrote:
Hi,

I have a floating point number, e.g. 45.6200, and I want to be able to store the whole number part and the fraction part separately, so that I can increment an integer value and keep the remainder (the fraction part) to be added on to a later increment value.

Does anyone know if there are any lingo commands for doing any of this - or have any ideas how else I might do this?

Maybe I could convert to a string and search for decimal point and extract numbers before that etc. but this seems a bit long winded.

Thanks in advance,
John

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to