I am working on an app that has to check a number in a range, between a high and low number. When alpha is reading the numbers it only reads the length of the the high or low number, which would be fine, except for the fact that it is reading it from left to right instead of right to left. For example:
If I need to check within the range of 40 and 50, alpha will only read the number of characters that is equal to the length of the high or low number, in this case it being two (one for 5, one for 0, the the number 50). Which again, would be totally fine if it read it from right to left, but it reads it left to right meaning the 45 will be calculated in the range, as well as the number 4,500! Because it only reads the first two numbers! I don't know why it does this, but I need to find a solution to it. I created a test project from scratch to illustrate what I mean. If anyone has any ideas or an explanation that would be great thanks!
*also note that it works if you do
, but that defeats the purpose of using these as variables.
highLowFail.png
highLowFail001.png
highLowFail002.png
If I need to check within the range of 40 and 50, alpha will only read the number of characters that is equal to the length of the high or low number, in this case it being two (one for 5, one for 0, the the number 50). Which again, would be totally fine if it read it from right to left, but it reads it left to right meaning the 45 will be calculated in the range, as well as the number 4,500! Because it only reads the first two numbers! I don't know why it does this, but I need to find a solution to it. I created a test project from scratch to illustrate what I mean. If anyone has any ideas or an explanation that would be great thanks!
*also note that it works if you do
Code:
var reading = 45; var high = 50; var low = 40;
Code:
var reading = {dialog.object}.getValue('Reading'); var high = {dialog.object}.getValue('High'); var low = {dialog.object}.getValue('Low'); if((reading > high) || (reading < low) ) { alert('The reading is out of range. ' + 'reading: ' + reading + ' high: ' + high + ' low: ' + low); } else { alert('The reading is in range. ' + 'reading: ' + reading + ' high: ' + high + ' low: ' + low); }
highLowFail001.png
highLowFail002.png
Comment