Number to string - defect / jumps

hello world!

in the lib " [gregmotorshop/time]" is the number-to-timestring somehow always jumping at 30s…
So if 30s are gone it display 1min 31s …and so on

I can not find the issue :no_mouth:

number-to-string.xodball (8.7 KB)

What are you passing into this patch? If I pass in seconds, it seems to work just as expected. I replaced input with tweak-number & deleted output pins so I could run directly. You actually get 31/1/0 as output when you pass 30 as input?

the input is a direct number from a timer (clock with counter).
I did the same with constant value to simulate this behaivor:

I don’t know what I did last time. I could have sworn it was working for me. This time I’m getting the same results. The problem is that fractional numbers are getting rounded up. You get the same problem with hour if you enter 3599 seconds (one second short of 1 hour). An easy solution is to “floor” the output of divide to drop the fractional part.

Thanks a lot.
Somehow i never had a look on “floor”. This is a nice node!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.