/*\ title: $:/core/modules/filters/range.js type: application/javascript module-type: filteroperator Filter operator for generating a numeric range. \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; /* Export our filter function */ exports.range = function(source,operator,options) { var results = []; // Split the operand into numbers delimited by these symbols var parts = operator.operand.split(/[,:;]/g), beg, end, inc, i, fixed = 0; for (i=0; i 10000) { return ["range: too many steps (over 10K)"]; } // Avoid rounding error on last step end += direction * 0.5 * Math.pow(0.1,fixed); var safety = 10010; // Enumerate the range if (endend; i+=inc) { results.push(i.toFixed(fixed)); if(--safety<0) { break; } } } else { for(i=beg; i