The XUL-to-web-client copy template converter created to fix
bug
1691269 needs a little help when the value stored is a
number rather than a string.
Thanks to Jeff Godin for troubleshooting help and Mike
Rylander for the suggested solution.
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Jeff Godin <jgodin@tadl.org>
stat_cats[field_name] = parseInt(curr_field["value"]);
} else {
tmp_val = curr_field['value']; // so... some of the number fields are actually strings. Groovy.
- if ( tmp_val.match(/^[-0-9.]+$/) && !(field_name.match(/(?:loan_duration|fine_level)/))) {
+ if ( tmp_val.toString().match(/^[-0-9.]+$/) && !(field_name.match(/(?:loan_duration|fine_level)/))) {
tmp_val = parseFloat(tmp_val);
}