I am starting to learn a bit of javascript to do a small project and I have run into a problem that I have not been able to solve in any way, I hope you can help me.
- I tell you a little about the project to know what it is: In a Increaseable table calls for measures [long] [width] [high] and In addition to this, the [weight] and the [quantity] are requested. After about calculations are obtained [Total Weight] [Total Volume]
- At the end you must have 2 different [Total] results.
- The result that will be housed in: [TotalAirUSD] must be calculated from the following way - > compare the [Total Weight] and [Total Volume] for know which is the GREATER between the two and save its value in a variable (var), then: if the variable is GREATER than 8 (var> 8) it must multiply by the variable rate (var * rate) to give as result [TotalAirUSD] - Otherwise [TotalAirUSD] is assigned a value of 20.
- Here's the problem: if you enter one of these numbers "4 5 6 7 8" in the field [Weight] then [TotalAirUSD] takes a value of 20 automatically (with the rest of the numbers it works fine)
Complete project: link
Simplified project to the problem: link
- Notes: When I enter a value in " Weight Total (totalweight) " multiplies by the value of " Air Rate " and returns the result in " Total Air USD " Except when entering any of these numbers: 4 , 5, 6, 7, 8, 9 does not meet the "IF > 8" condition and automatically goes to the total value of "20"