Update bitcoin-uri.service.js

Add the conversion to satoshi however a currency can be precised, in that case, the satoshi conversion should be not operated.
This commit is contained in:
Jean-Baptiste Dominguez 2018-08-31 18:36:40 +09:00 committed by GitHub
commit fa15b26792
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,8 +205,8 @@
switch(key) {
case 'amount':
var amount = parseFloat(decodedValue);
if (amount) { // Checking for NaN, or no numbers at all etc.
parsed.amount = decodedValue;
if (amount) { // Checking for NaN, or no numbers at all etc. & convert to satoshi
parsed.amount = decodedValue * 100000000; // Need to check if a currency is precised
} else {
return parsed;
}
@ -342,4 +342,4 @@
}
})();
})();