Skip to content
This repository has been archived by the owner on Jan 11, 2018. It is now read-only.

Commit

Permalink
total: use newTotal instead of rawNewTotal
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Van Camp committed Jan 7, 2017
1 parent 61e69ba commit 6718ce0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions extension/total.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ module.exports = function (nodecg) {
* @param {Number} rawNewTotal - The new numeric donation total, including this donation.
* @returns {{amount: String, rawAmount: Number, newTotal: String, rawNewTotal: Number}} - A formatted donation.
*/
function formatDonation({rawAmount, rawNewTotal}) {
function formatDonation({rawAmount, newTotal}) {
rawAmount = parseFloat(rawAmount);
rawNewTotal = parseFloat(rawNewTotal);
const rawNewTotal = parseFloat(newTotal);

// Format amount
let amount = formatDollars(rawAmount);
Expand Down
4 changes: 2 additions & 2 deletions scripts/test_donation_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function generateAndEmitDonation() {
totalInCents += rawAmountInCents;

const data = {
rawAmount: rawAmountInCents / 100,
rawNewTotal: totalInCents / 100
rawAmount: String(rawAmountInCents / 100),
newTotal: String(totalInCents / 100)
};

io.emit('donation', data);
Expand Down

0 comments on commit 6718ce0

Please sign in to comment.