Intl NumberFormat does not show the Bitcoin Symbol

0 votes

the Intl.NumberFormat does not show the bitcoin symbol.

CFORMAT_USD = new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'USD', minimumFractionDigits: 8 }); 
CFORMAT_BTC = new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'BTC', minimumFractionDigits: 8 }); 

console.log(CFORMAT_USD.format(1000));
// 1.000,00000000 $

console.log(CFORMAT_BTC.format(1000));  
// 1.000,00000000 BTC

My workaround at the moment

console.log(CFORMAT_BTC.format(1000).replace(/BTC/,'Ƀ'));
// 1.000,00000000 Ƀ

Is there maybe a better (clean) solution?

Aug 27, 2018 in Blockchain by digger
• 26,700 points
515 views

1 answer to this question.

0 votes

According to bitcoin.it (https://en.bitcoin.it/wiki/Bitcoin_symbol),

The ISO 4217 currency code for Bitcoin is XBT. However, at the moment it is an unofficial code according to the ISO 4217 standard.

So the correct code should be

Intl.NumberFormat('de-DE', { style: 'currency', currency: 'XBT' })
answered Aug 27, 2018 by slayer
• 29,300 points

Related Questions In Blockchain

0 votes
2 answers

Why does not India consider Bitcoin as a legal tender?

to be specific there are few logical ...READ MORE

answered Jul 2, 2018 in Blockchain by Priyaj
• 58,120 points
194 views
0 votes
1 answer

Is it possible to claim Bitcoin Cash from an exchange that does not support it?

You can't claim BCH without knowing private ...READ MORE

answered Jul 17, 2018 in Blockchain by aryya
• 7,440 points
140 views
0 votes
1 answer

Bitcoin sendfrom does not process transaction

Try this; $wammount = floatval(trim($_POST['wammount'])); READ MORE

answered Sep 3, 2018 in Blockchain by digger
• 26,700 points
119 views
0 votes
1 answer

"[RuntimeException] The "-t" option does not exist" error in Hyperledger composer.

This command runs on composer-cli. Have you ...READ MORE

answered Nov 21, 2018 in Blockchain by Omkar
• 69,130 points
666 views
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,440 points
425 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,830 points
574 views
0 votes
1 answer