LessThanPercentage

Checks if one percentage is less than another Returns less: if firstPercentage < secondPercentage Returns more: if firstPercentage >= secondPercentage Returns exception if one of the inputs is not a float

javascript · Common Scripts

Source

first = parseFloat(args.firstPercentage);
if (!first) {
    throw 'firstPercentage is not valid: '+args.firstPercentage;
}
second = parseFloat(args.secondPercentage);
if (!second) {
    throw 'firstPercentage is not valid: '+args.secondPercentage;
}
if (first < second) {
    return 'less';
} else {
    return 'more';
}

README

Checks if one percentage is less than another.

Returns less: if firstPercentage < secondPercentage.
Returns more: if firstPercentage >= secondPercentage.
Returns an exception if one of the inputs is not a float.

Script Data


Name Description
Script Type javascript
Tags Utility, Condition

Inputs


Argument Name Description
firstPercentage The first percentage.
secondPercentage The second percentage.

Outputs


Path Description Type
less Whether the firstPercentage is less than (<) the secondPercentage. Unknown
more Whether the firstPercentage greater than or equal to (>=) the secondPercentage. Unknown