Dear community,
is there a chance to convert the [line] objects output to one decimal bit showing the stream in this format: x.y
Thank you!!
Convert [line] output to a float value with only one decimal bit
Dear community,
is there a chance to convert the [line] objects output to one decimal bit showing the stream in this format: x.y
Thank you!!
@Moothart [int] rounds a number to an integer.
So if you multiple your values by 10... then pass them through [int] and divide the result by 10 you will have values with one decimal point.
David.
Works fine! (tought about a parameter in [float] to truncate or such...) Thanks very much!!
@Moothart [expr] also has some options here, rint, round, nearbyint, ceil and floor can round out the options. Open the help for [expr], and then the subpatch that is something like [pd all functions and operations] and then into the subpatch that is something like [pd misc numeric operations] for more info, going from memory on those subpatches. [i ] often works but it always rounds down, 0.999 will be 0 which can be irritating and not at all what you want. And you can stick the division right in there, [expr round($f1)/10]. [expr] is not as efficient as the normal math objects, generally we don't need to worry about this much with modern cpus unless you are using [fexpr~] or [expr~] in a subpatch with a small blocksize, but it is good to keep in mind and not just use it because it is easy.
Oops! Looks like something went wrong!