From 1ab342fc206b9a682a2bcc33e19642e10b0c09d3 Mon Sep 17 00:00:00 2001 From: MattMo Date: Wed, 8 Oct 2025 07:00:01 -0700 Subject: [PATCH] Added a formatter option to the numbers generator. --- ignite-html-select.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ignite-html-select.js b/ignite-html-select.js index 02da033..16027e3 100644 --- a/ignite-html-select.js +++ b/ignite-html-select.js @@ -516,9 +516,10 @@ IgniteTemplate.prototype.countries = function(placeholder = null) { * @param {String} placeholder The placeholder option if set, it's value will be -1, this will be the text displayed. * @param {Number} placeholderValue The value of the placeholder option if the placeholder is set. Default is -1. * @param {Boolean} descending Whether or not the from number if first and the to number is last. + * @param {Function} formatter Optional function to format the display value of each option. * @returns {IgniteTemplate} This ignite template. */ - IgniteTemplate.prototype.numbers = function(from = 0, to = 100, placeholder = null, placeholderValue = -1, descending = false) { + IgniteTemplate.prototype.numbers = function(from = 0, to = 100, placeholder = null, placeholderValue = -1, descending = false, formatter = null) { //Generate html and populate the template with it. var html = ''; @@ -528,11 +529,11 @@ IgniteTemplate.prototype.countries = function(placeholder = null) { if (descending) { for (var i = to; i >= from; i--) { - html += ``; + html += ``; } } else { for (var i = from; i <= to; i++) { - html += ``; + html += ``; } }