Forums > MaxMSP

displaying numbers

August 31, 2013 | 11:37 am

often i am using lcd instead of numberboxes to display numbers. what i find annoying is that lcd displays zerois behind the last value, e.g. 82.125000.

do you have an idea what is the best way to cut off these 0´s – avoiding regexp and itoa/atoi?

-110


September 1, 2013 | 5:12 am

[regexp] is probably the way to go. Otherwise, you could do some custom JScript, Java, or «gasp!» C.

The long and the short of it is that, until lcd has an attribute allowing you to specify the formatting conventions for float-to-string, you’re going to have to use some object to pre-process the float into the string (symbol) format you want.


September 1, 2013 | 4:31 pm

damn, thats what i thought.

so i will not search für zeros, i will just split the numbers at the comma and limit the right part to three characters.


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