Forums > MaxMSP

sprintf _nothing_ ??

September 5, 2006 | 4:06 pm

hi

I am using sprintf in the following format : [sprintf %s%s:%s%s],
which lets me have a nice clock in a LCD (or message box probably) in
a format something like 12:45, or 01:56

that’s fine

now when i want to see negative values ( how long to wait until
something happens…) i can easily have -10:21 (still fine) but i
would like to have also -4:39…

meaning i would like the first %s (leftmost) to output nothing……
for the moment i just output a dot (.) so my format is .-4:54… but
is there a way to input something which will be output as nothing???

many thanks

kasper

Kasper T. Toeplitz
noise, composition, bass, computer

http://www.sleazeArt.com


September 5, 2006 | 4:50 pm

Salut Kasper,

On 05-sept.-06, at 18:06, Kasper T Toeplitz wrote:

> I am using sprintf in the following format : [sprintf %s%s:%s%s],
> which lets me have a nice clock in a LCD (or message box probably) in
> a format something like 12:45, or 01:56
>
> that’s fine
>
> now when i want to see negative values ( how long to wait until
> something happens…) i can easily have -10:21 (still fine) but i
> would like to have also -4:39…
>
> meaning i would like the first %s (leftmost) to output nothing……
> for the moment i just output a dot (.) so my format is .-4:54… but
> is there a way to input something which will be output as nothing???

Something like this may help: [sprintf %02d:%.2d]
You just need to send the 2 int numbers, without having to think to the
0 padding.

I hope it helps!

p


Viewing 2 posts - 1 through 2 (of 2 total)