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

Bug in The WildOasis Project #76

Open
arnold-zhang-jlu opened this issue Jul 1, 2024 · 2 comments
Open

Bug in The WildOasis Project #76

arnold-zhang-jlu opened this issue Jul 1, 2024 · 2 comments

Comments

@arnold-zhang-jlu
Copy link

image
Discount Validation has some problems

@yonathandevpro
Copy link

In case, anybody is stuck on this problem, The problem arised because both the type of VALUES and GETVALUES() is a string. When you compare two strings, Javascript compares them lexicographically, basically treating the numbers as strings.

For example, when it compares 100 and 90, it first compares the first digits: 1 and 9. Since 9 is greater, it assumes 90 is greater than 100. So, to correct that, put both VALUES AND GETVALUES as arguments in Number(). e.g. Number(values)..

This will ensure correct comparison.

@jakhongir20
Copy link

Nice job, @yonathandevpro 👍🏻

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

3 participants