split floating point number at decimal


    Jan 19 2012 | 1:31 pm
    I'm trying to take a floating point number and divide it at the decimal into two separate integers. I've been looking at sprintf and regexp but have been unable to figure out how to achieve this. Can someone point me in the right direction, please?

    • Jan 19 2012 | 1:38 pm
      Max Patcher
      In Max, select New From Clipboard.
      This works to some extent. The issue generates some problems as in max it is impossible to pass a value like 012 when that would be part of e.g. 3.012. Leading zeros are automatically dumped. Wish it was that way in politics.
    • Jan 19 2012 | 1:46 pm
      Max Patcher
      In Max, select New From Clipboard.
      This may give you some ideas (not sure it works in all cases, but it seems so):
    • Jan 19 2012 | 8:59 pm
      Max Patcher
      In Max, select New From Clipboard.
      I've done it like this:
    • Jan 19 2012 | 9:06 pm
      something like [expr $f1 - int($f1)] will give you 0.012.
    • Mar 23 2017 | 2:15 am
      Max Patcher
      In Max, select New From Clipboard.
      Sorry to revive an old thread but I wanted to post a simplified solution to the problem.