Hi, I'm using jQuery and I need to display the difference between two values. The values change so if I just take value1 minus value2, the results will sometimes be negative, but I need the difference which is of course always positive.
I know I could use conditional statements, like if value1 is larger than value2, show value1 minus value2, but I'm sure there is a better way, something likedifference(value1, value2)orvar difference = makePositive(difference);
Thanks for your help!



Reply With Quote

Bookmarks