[PD] split number into digits

José Rafael Subía Valdez jsubiavaldez at gmail.com
Sun Jan 17 19:29:42 CET 2021


maybe with [mod]. Is the number always going to have 3 digits??

playing around in 3 minutes, I came up with this (see picture attached). I
do not consider it to be elegant, but maybe its a place to start

cheers

On Sun, Jan 17, 2021 at 1:18 PM Antoine Rousseau <antoine at metalu.net> wrote:

> You can do this:
> - transform "float 512" into "symbol 512" using [makefilename %d]
> - then transform "symbol 512" into "list 53 49 50" with [list fromsymbol].
> - finally subtract 48 (which is the ascii for "0") from every item, you
> get "5 1 2"
>
>
> Le dim. 17 janv. 2021 à 18:23, Jeppi Jeppi <jeppiot at hotmail.com> a écrit :
>
>> Hi there,
>> which would be your most elegant way to split a number into a list of
>> digits? that is, I have the number 512 and I want the list 5 1 2
>> _______________________________________________
>> Pd-list at lists.iem.at mailing list
>> UNSUBSCRIBE and account-management ->
>> https://lists.puredata.info/listinfo/pd-list
>>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>


-- 
José Rafael Subía Valdez
www.jrsv.net


*"...I am an Anarchist! Wherefore I will*
*Not rule, and also ruled I will not be!"*

- John Henry Mackay -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20210117/a4cee513/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot_2021-01-17_13-26-40.png
Type: image/png
Size: 6823 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20210117/a4cee513/attachment.png>


More information about the Pd-list mailing list