Stripping numbers…

Jun 6, 2010 at 1:22am

Stripping numbers…

Hi,

I’m having a problem trying to turn the output from a number box into a series of single numbers – eg. 25.5 becomes 3 number boxes, one with a 2 one with a 5 and one .5 (NB. the first number should be two, and not 20, so dividing seems like it won’t work).

Essentially it makes me think of the unpack object but not for lists – for number boxes. Also, the numbers I am using into are all <100, and only have one decimal point (always a .5 - it is a counter I am building).

Many thanks,
Jamie

#50751
Jun 6, 2010 at 1:30am

http://cycling74.com/forums/topic.php?id=26608

Go with the divide and modulo method from Chris Muir, it really is much faster than regexp.

#182094
Jun 6, 2010 at 1:36am

/ and % are your friends:

– Pasted Max Patch, click to expand. –
#182095
Jun 6, 2010 at 10:06am

Hi,

Thank you for the replies. I think that approach is perfect. I’ve used Max for a while but never posted on the forum before. Thanks so much for the extremely quick help.

Jamie

#182096
Jun 6, 2010 at 3:23pm

O.T.
I lurk this forum almost every day, and whenever Chris Muir posts a response/patch to ANY question, I always save it in a Max folder called ‘utilities’. His stuff never ceases to amaze me. I might just rename that folder to ‘Chris Muir’.

#182097
Mar 8, 2011 at 11:37pm

yep my folder is actually named “cmuir”!

#182098

You must be logged in to reply to this topic.