SalsaScript to retrieve the most recent donation and make it look like a real number (e.g. a donation of 5 looks like 5.00).
<p><? | |
(function() { | |
amount = "0.00"; | |
try { | |
_donations = supporter.getObjects('donation', { | |
orderBy: [ '-TransactionDate' ], | |
limit: 1 | |
}); | |
if (_donations != null && _donations.length != 0) { | |
amount = parseFloat(_donations[0].amount).toFixed(2); | |
} | |
} catch(e){ | |
} | |
})(); | |
?></p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment