Page 1 of 1

Posted: 22 Dec 2015, 09:37
by rlgsbt
Hi,
How can I turn "3" into "03". It's for a clock or a counter.
thanks
SB

by the way, is it possible to get the rests after a modulo ?

Posted: 22 Dec 2015, 17:35
by 23fx23
you can use concat string module and add your string to the first beeing 0;

not sure if well understood but can substract modulo result to original value to get the rest maybe?

Posted: 23 Dec 2015, 09:11
by rlgsbt
Thanks 23fx23,
Substract modulo result from original value is good ! but for concat string, I want to have 2 digits (from 01 to 59) even if the input is 1, 2, 3 ( I want to turn it in 01, 02, 03... 10, 11...).

Posted: 23 Dec 2015, 19:29
by 23fx23
one of the possible solutions is to add & concat the 0 string, ie take your 1,2,3 ect value, convert to string using 'int to string', this feed input 2 of concat string module. on first input of concat string module type the 0. this will add a 0 before all incoming numbers, so will get a result like 01,02,03... then 010, 011 ect.
then if want only displaying 10 instead of 010, can use an extract sub-array to keep only 2 last digits. (as text is array)
ie on the module set the length to 2 and the start pos is connected to a if a>9. so you would get back 01,02,... 10,11