import {FormControl} from "@angular/forms";

export function NumberAndNoNegative(controlName:FormControl) {
	const VALUE = Number(controlName.value);
	if (!Number.isInteger(VALUE)) {
		return {
			type_number: {
				parsedValue: VALUE
			}
		}
	}

	if (VALUE < 0) {
		return {
			no_negative: {
				parsedValue: VALUE
			}
		}
	}
	return null;
}
