mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-23 17:08:10 -07:00
global: private xpub support part 1
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @param {number} value
|
||||
*/
|
||||
export function formatNumber(value) {
|
||||
return new Intl.NumberFormat("en-US").format(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} sats
|
||||
*/
|
||||
export function formatBtc(sats) {
|
||||
return `${(sats / 100_000_000).toLocaleString("en-US", {
|
||||
maximumFractionDigits: 8,
|
||||
})} BTC`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} dollars
|
||||
*/
|
||||
export function formatUsd(dollars) {
|
||||
return new Intl.NumberFormat("en-US", {
|
||||
currency: "USD",
|
||||
maximumFractionDigits: 0,
|
||||
style: "currency",
|
||||
}).format(dollars);
|
||||
}
|
||||
Reference in New Issue
Block a user