MediaWiki:MonthlyConvert.js: Difference between revisions

Content deleted Content added
No edit summary
re-use donationForm.parseOtherAmount
Line 155:
otherAmount = null;
 
// Check the "other" amount box
if ( otherInput.value !== '' ) {
otherAmount = donationForm.parseOtherAmount( otherInput.value );
otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
otherAmount = otherAmount.replace(/[\$£€¥,.]/g, '');
otherAmount = otherAmount.replace(/:/, '.');
}
 
otherAmount = parseFloat( otherAmount );
 
if ( isNaN( otherAmount ) ) {
return 0;
} else {
return otherAmount;
}
 
if ( isNaN(return otherAmount ) ) {;
};