function RuleTypeNumberWidgetType(id, value)
{
    this.value    = null;
    this.widgetid = '';

    if (typeof value !== 'undefined' && value !== null) {
        this.value = value;
    }

}

RuleTypeNumberWidgetType.prototype = {
    reset: function()
    {
        this.simpleResult = false;
        this.widget       = null;
        this.value        = null;
        this.server       = true;
        this.client       = true;
        this.errors       = [];

    },

    setWidgetid: function(wid)
    {
        this.widgetid = wid;

    },

    setValue: function(val)
    {
        this.value = val;

    },

    validate: function()
    {
        // Check if this is a numberic value.
        var val = Number(this.value);
        if (isNaN(val) === true) {
            return false;
        }

        // PHPCS will complain, but we cannot use strict comparison operator.
        var checkVal = parseInt(this.value, 10);
        if (val != checkVal) {
            checkVal = parseFloat(this.value);
            if (val != checkVal) {
                return false;
            }
        }

        return true;

    },

    getErrors: function()
    {
        return this.errors;
    }

};
