Browse Source

FIX: Writing numbers standards #194

map
Marcos Rodriguez Vélez 6 years ago
parent
commit
3035747af3
  1. 2
      ios/BlueWallet/Info.plist
  2. 4
      loc/index.js
  3. 8
      screen/wallets/import.js

2
ios/BlueWallet/Info.plist

@ -33,7 +33,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>228</string>
<string>229</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

4
loc/index.js

@ -110,7 +110,7 @@ strings.formatBalance = (balance, toUnit, withFormatting = false) => {
return balance + ' ' + BitcoinUnit.BTC;
} else if (toUnit === BitcoinUnit.SATS) {
const value = new BigNumber(balance).multipliedBy(100000000);
return (withFormatting ? new Intl.NumberFormat().format(value.toString()).replace(',', ' ') : value) + ' ' + BitcoinUnit.SATS;
return (withFormatting ? new Intl.NumberFormat().format(value.toString()).replace(/[^0-9]/g, ' ') : value) + ' ' + BitcoinUnit.SATS;
} else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) {
return currency.BTCToLocalCurrency(balance);
}
@ -131,7 +131,7 @@ strings.formatBalanceWithoutSuffix = (balance, toUnit, withFormatting = false) =
const value = new BigNumber(balance).dividedBy(100000000).toFixed(8);
return removeTrailingZeros(value);
} else if (toUnit === BitcoinUnit.SATS) {
return withFormatting ? new Intl.NumberFormat().format(balance).replace(',', ' ') : balance;
return withFormatting ? new Intl.NumberFormat().format(balance).replace(/[^0-9]/g, ' ') : balance;
} else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) {
return currency.satoshiToLocalCurrency(balance);
}

8
screen/wallets/import.js

@ -68,14 +68,6 @@ export default class WalletsImport extends Component {
try {
// is it lightning custodian?
if (text.indexOf('blitzhub://') !== -1 || text.indexOf('lndhub://') !== -1) {
// yep its lnd
for (let t of BlueApp.getWallets()) {
if (t.type === LightningCustodianWallet.type) {
// already exist
return alert('Only 1 Ligthning wallet allowed for now');
}
}
let lnd = new LightningCustodianWallet();
lnd.setSecret(text);
await lnd.authorize();

Loading…
Cancel
Save