Suppress decimal precision on jsliveapi str_for_value call?

Nick Suda's icon

Does anyone know if this is possible?

I'm making a front end that is displaying true parameter values coming from Ableton Live instead of approximating their values with range of the live.dial that the control signal is coming from. I've covered up its value display and replaced it with a comment box that displays the output of a JS str_for_value call on a DeviceParameter.

If you're doing it on a mixer_device volume object, for example, it could spit out something like "-7.124761824581245 dB". Maybe not that long of a mantissa, but still, more than is reasonable to display on a GUI.

Anyway I can suppress display precision to two points?

Thanks.