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
Number comparison problem #110
Comments
Nools uses a strict equals so your "79.00" will not |
Well really what I"m passing in is p.price == 79 so I can't really do: parseInt(p.price, 10 ) at that the same time, I'm not sure that loosening the strict matching is an answer either, people can run into issues if they don't know what they're doing. Let me know where I should I look, and I can take a gander. Looks like some of this is happening in contraints.js ... i'm not sure I can follow it w/ out a sequence diagram or a specific instructions but I can look nonetheless. |
Also this is why I hate dynamic type languages 🔢 , makes everything more complicated |
Doug, Let me know if you had a chance to look at this or where I would update this at. This is a blocker as I'm about to roll Nools out into production. |
Okay I got this working by a hack: parseInt didn't work, but i was able to do this: // p.price = '79.00' (p.price * 1) == 79 // true It makes sense that 'price' should be a float to begin with... but part of what I'm using Nools for is data normalization so its important that I get it working from the nools end. Anyway were good for now |
* Added new `===` and `!==` operators [noolsjs#110](noolsjs#110) * Fix for issue [noolsjs#109](noolsjs#109) * Updated Readme * Updated agenda groups examples for [noolsjs#105](noolsjs#105)
* Added new `===` and `!==` operators noolsjs#110 * Fix for issue noolsjs#109 * Updated Readme * Updated agenda groups examples for noolsjs#105 * Changed class names not to match property names in readme noolsjs#99
* Added new `===` and `!==` operators noolsjs#110 * Fix for issue noolsjs#109 * Updated Readme * Updated agenda groups examples for noolsjs#105 * Changed class names not to match property names in readme noolsjs#99
Ok I added I hope this helps. -Doug |
Thanks Doug. |
Doug,
Maybe i'm doing something wrong,
But when I run rule matching on this expression, matching fails
"79.00" == 79 .. in JSFiddle ofcourse this evaluates to true.
Rule matching is working for this however...
"79.00" <= 100 -> true
It seems like that number comparison maybe getting translated somewhere down the stack.
Thanks
The text was updated successfully, but these errors were encountered: