Forums > MaxMSP

About Max js (the value inputed is odd)

January 18, 2011 | 4:59 pm

In the js(Max JavaScript object),I used the function "list()".
And When a value list is passed from the inlet into the function, the value seems to become different.

Please see the following image in which JavaScript code is written.
The list passed from the inlet is recieved by "arguments".
But checking with the Max window,the value is obviously different from that is inputed.
(in the following image ,"0.18—–0.59—-0.74" are the values.)

"more infomation"
・The list is sent from "zl group". And zl recieve values from "peek" by "metro" and "counter" one after another.(par 0.3ms)
・The values composing the list are float number.

Why does such a thing happen?

Please give me a solution.

[attachment=151580,1689] [attachment=151580,1690] [attachment=151580,1691] [attachment=151580,1692]

Attachments:
  1. 201101191.25.45.png

January 19, 2011 | 2:22 am

Try using toFixed:

arguments[0].toFixed(6)


January 20, 2011 | 1:15 pm

Thank you very much!

I tried it. Your advice has settled!


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