Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Commit

Permalink
add numberHelper function to maintain $.fn.fmatter.integer parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
bouks committed Dec 31, 2014
1 parent 38aba44 commit 10b1cd7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions external/jquery.fmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,23 @@
}
return $.fn.fmatter.defaultFormat(cellval,opts);
};
$.fn.fmatter.integer = function (cellval, opts, op, action) {
op = (action === undefined) ? op || $.extend({}, opts.integer) : $.extend({}, opts.integer);
$.fn.fmatter.numberHelper = function(cellval, opts, op){
op = op || $.extend({}, opts.integer);
if (opts.colModel !== undefined && opts.colModel.formatoptions !== undefined) {
op = $.extend({}, op, opts.colModel.formatoptions);
op = $.extend({}, op, opts.colModel.formatoptions);
}
return ($.fmatter.isEmpty(cellval)) ? op.defaultValue : $.fmatter.util.NumberFormat(cellval, op);
};
$.fn.fmatter.integer = function (cellval, opts) {
return $.fn.fmatter.numberHelper(cellval, opts);
};
$.fn.fmatter.number = function (cellval, opts) {
var op = $.extend({}, opts.number);
return $.fn.fmatter.integer(cellval, opts, op);
return $.fn.fmatter.numberHelper(cellval, opts, op);
};
$.fn.fmatter.currency = function (cellval, opts) {
var op = $.extend({}, opts.currency);
return $.fn.fmatter.integer(cellval, opts, op);
return $.fn.fmatter.numberHelper(cellval, opts, op);
};
$.fn.fmatter.date = function (cellval, opts, rwd, act) {
var op = $.extend({},opts.date);
Expand Down

0 comments on commit 10b1cd7

Please sign in to comment.