{"size": 639, "ext": "js", "max_stars_repo_path": "_js/script.js", "max_stars_repo_name": "leandro-araujo-silva/Calculadora-DRE", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "_js/script.js", "max_issues_repo_name": "leandro-araujo-silva/Calculadora-DRE", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "_js/script.js", "max_forks_repo_name": "leandro-araujo-silva/Calculadora-DRE", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.6315789474, "max_line_length": 80, "alphanum_fraction": 0.6525821596}
const calcular = document.getElementById('calcular');

function dre() {
    const receita = document.getElementById('bruta').value;
    const impostos = document.getElementById('impostos').value;
    const cmv = document.getElementById('cmv').value;
    const resultado = document.getElementById('resultado');

    if(receita !== '' && impostos !== '' && cmv !== '') {
        const valorDRE = (receita - impostos - cmv).toFixed(2);

        resultado.textContent = `Olá, o lucro bruto equivale a R$ ${valorDRE}.`;

    } else {
        resultado.textContent = 'Preencha todos os campos!';
    }
}

calcular.addEventListener('click', dre);