mirror of
https://github.com/fullstack-cash/fullstack-gatsby-theme-bch-wallet.git
synced 2026-09-21 16:52:06 -07:00
fix(orders): Fixing bug with sats to bch calculation
This commit is contained in:
@@ -203,7 +203,8 @@ class Orders extends React.Component {
|
|||||||
const order = dataArr[i]
|
const order = dataArr[i]
|
||||||
// console.log(`order: ${JSON.stringify(order, null, 2)}`)
|
// console.log(`order: ${JSON.stringify(order, null, 2)}`)
|
||||||
|
|
||||||
const satsTotal = order.numTokens * order.rateInBaseUnit
|
const satsTotal = Math.ceil(order.numTokens * order.rateInBaseUnit)
|
||||||
|
console.log(`satsTotal: ${satsTotal}`)
|
||||||
let usdTotal = bchSpotPrice * this.props.bchWallet.bchjs.BitcoinCash.toBitcoinCash(satsTotal)
|
let usdTotal = bchSpotPrice * this.props.bchWallet.bchjs.BitcoinCash.toBitcoinCash(satsTotal)
|
||||||
usdTotal = `$${this.props.bchWallet.bchjs.Util.floor8(usdTotal)}`
|
usdTotal = `$${this.props.bchWallet.bchjs.Util.floor8(usdTotal)}`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user