﻿function WeightValidate(source, arguments) {
    var weight = arguments.Value;
    var commasCount = weight.split(',').length - 1;
    if (commasCount > 0) {
        for (i = 0; i < commasCount; i++) {
            weight = weight.replace(',', '');
        }
    }
    var floatWeight = parseFloat(weight);
    var intWeight = parseInt(weight);
    if (floatWeight < 100000 && floatWeight > 0 && floatWeight == intWeight) {
        arguments.IsValid = true;
    }
    else {
        arguments.IsValid = false;
    }
}