<commit_before>'use strict';
// calculate the raw monthly payment
// pass the total amount of the loan, the APR, and the length of the loan in months
var paymentCalc = function(loanAmt, loanRate, loanTerm) {
  // monthly interest rate
  var monthlyRate = (loanRate/100)/12;

  // calculate the monthly payment
  // MonthlyPayment = Pincipal * ( MonthlyInterest / (1 - (1 + MonthlyInterest)^ -Months))
  return loanAmt * (monthlyRate / (1 - Math.pow(1 + monthlyRate, -(loanTerm))));
};

// round numbers to two decimal places
var roundNum = function(num) {
  return num.toFixed(2);
};

// pass the amount of the loan, percentage rate, and length of the loan in months
exports.paymentCalc = function(loanAmt, loanRate, loanTerm) {
  // calculate monthly payment
  var monthlyPayment = paymentCalc(loanAmt, loanRate, loanTerm);

  // round the payment to two decimal places<commit_msg>a better way of rounding<commit_after>'use strict';
// calculate the raw monthly payment
// pass the total amount of the loan, the APR, and the length of the loan in months
var paymentCalc = function(loanAmt, loanRate, loanTerm) {
  // monthly interest rate
  var monthlyRate = (loanRate/100)/12;

  // calculate the monthly payment
  // MonthlyPayment = Pincipal * ( MonthlyInterest / (1 - (1 + MonthlyInterest)^ -Months))
  return loanAmt * (monthlyRate / (1 - Math.pow(1 + monthlyRate, -(loanTerm))));
};

// round numbers to two decimal places
var roundNum = function(num) {
  return Math.round(num * 100) / 100;
};

// pass the amount of the loan, percentage rate, and length of the loan in months
exports.paymentCalc = function(loanAmt, loanRate, loanTerm) {
  // calculate monthly payment
  var monthlyPayment = paymentCalc(loanAmt, loanRate, loanTerm);

  // round the payment to two decimal places
{'fraction_non_alphanumeric': 0.10626398210290827, 'fraction_numerical': 0.013982102908277404, 'mean_word_length': 3.9148351648351647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '28249', 'n_tokens_mistral': 548, 'n_tokens_neox': 508, 'n_words': 201}