Skip to main content

Bug Tracker

Side navigation

#11929 closed bug (invalid)

Opened June 18, 2012 04:23PM UTC

Closed June 18, 2012 05:13PM UTC

cannot compare 9 and 10, 99 and 100, 999 and 1000 etc...

Reported by: shravan.aljapur@gmail.com Owned by: shravan.aljapur@gmail.com
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

cannot compare 9 and 10, 99 and 100, 999 and 1000 etc... similarly you can check for other no's as well.

I'm passing two no's using 2 text boxes and trying to compare two values works fine most of the times. but fails when tried as above. and it works fine when i'm giving 09 and 10, 099 and 100, 0999 and 1000. it just compares same digit nos only. Blindly compares only units place when there is change in no of digits of any given number.

10>9 (returns false)

10>09 (returns true)

Attachments (0)
Change History (2)

Changed June 18, 2012 04:57PM UTC by rwaldron comment:1

owner: → shravan.aljapur@gmail.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/

Open the link and click to "Fork" (in the top menu) to begin.

Changed June 18, 2012 05:13PM UTC by dmethvin comment:2

resolution: → invalid
status: pendingclosed

I think rwaldron is getting soft. Please ask for help on a place like StackOverflow or other forum where they can patiently walk you through the issues of comparing strings to each other. jQuery does not make any changes to the JavaScript comparison operators.