Commit 11ff0e7a authored by Petr Balga's avatar Petr Balga

When input NaN, show 0 instead of "NaN"

parent 12dfd48b
......@@ -21,7 +21,9 @@ $(document).ready(function(){
function calculation(action) {
var currency = $('.select__currency').attr('currency');
var dollars = parseInt($('.dollar').val().replace('$', '').replace(',', ''));
if(isNaN(dollars)){ dollars = 0; }
var amount = parseInt($('.input__currency').val().replace(prefixes[currency], '').replace(',', ''));
if(isNaN(amount)){ amount = 0; }
var vypocet = 0;
switch(action){
case 'multiple': //From dollar to other
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment