Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] Récupérer les décimales des attributs des nodes #8

Open
skidlucas opened this issue Jul 13, 2016 · 1 comment
Open

[JS] Récupérer les décimales des attributs des nodes #8

skidlucas opened this issue Jul 13, 2016 · 1 comment

Comments

@skidlucas
Copy link

Je crée un nouveau noeud dans le graphe :

...
var sensor0 = graph.newNode(0, 0);
    sensor0.set("name", "sensor0");
    sensor0.set("value", 30.0);
...

Puis quand je récupère l'attribut en JS j'obtiens : "value: 30" au lieu de 30.0

@lmouline
Copy link

C'est dû au typage de JS :)
Il n'y a que la notion de "number" -> http://www.w3schools.com/js/js_datatypes.asp
Si tu mets 30.5, il devrait bien te retourner 30.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants