Last active
July 12, 2017 20:44
-
-
Save salsalabs/7e8303e3a7b492039e97f8640f731457 to your computer and use it in GitHub Desktop.
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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