Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Wait until {formatTime(leg.startTime - tncData.estimatedArrival * 1000, timeOptions)} to book
)}
{/* The estimated travel time */}
<div>
Estimated travel time: {formatDuration(leg.duration)} (does not account for traffic)
</div>
{/* The estimated travel cost */}
{tncData.minCost &&
<p>Estimated cost: {
`${currencyFormatter.format(tncData.minCost, { code: tncData.currency })} - ${currencyFormatter.format(tncData.maxCost, { code: tncData.currency })}`
}</p>
}
)
}
}
<a style="{{" href="{universalLinks[legMode.label.toUpperCase()]}">
Book Ride
</a>
{tncData && tncData.estimatedArrival
? <p>ETA for a driver: {formatDuration(tncData.estimatedArrival)}</p>
: <p>Could not obtain eta estimate from {toSentenceCase(legMode.label)}!</p>
}
{/* tncData && tncData.travelDuration &&
<p>Estimated drive time: {formatDuration(tncData.travelDuration)}</p> */}
{tncData && tncData.minCost
? <p>Estimated cost: {
`${currencyFormatter.format(tncData.minCost, { code: tncData.currency })} - ${currencyFormatter.format(tncData.maxCost, { code: tncData.currency })}`
}</p>
: <p>Could not obtain ride estimate from {toSentenceCase(legMode.label)}!</p>}
}
)
}
}
const BigAmount = ({ type, showPlusMinusSymbol, value, currency }) => {
switch (type) {
case "currency": {
const { decimalSeparator, spaceBetweenAmountAndSymbol, symbol, symbolOnLeft } = currencyFormatter.findCurrency(
currency,
);
const formattedValue = currencyFormatter.format(Math.abs(value), {
code: currency,
symbol: "",
});
const [integerValue, decimalValue] = formattedValue.split(decimalSeparator);
const optionalSpacing = spaceBetweenAmountAndSymbol ? " " : "";
return (
{showPlusMinusSymbol && value > 0 && {PLUS_SYMBOL}}
{showPlusMinusSymbol && value < 0 && {MINUS_SYMBOL}}
{symbolOnLeft && {`${symbol}${optionalSpacing}`}}
{integerValue && <span>{integerValue}</span>}
{decimalValue && {`${decimalSeparator}${decimalValue}`}}
usdBalance() {
let btcPrice = this.props.btcPrice
const btcBalance = this.props.coreWalletBalance
btcPrice = Number(btcPrice)
const usdBalance = btcPrice * btcBalance
return currencyFormatter.format(usdBalance, { code: 'USD' })
}
const fiatFormatter = currency => amount => Currency.format(amount, { code: currency.toUpperCase() })
const DocumentHead = ({ selectedCryptocurrency, selectedCurrency, spotPrice }) => {
const cryptocurrencySymbol = selectedCryptocurrency.toUpperCase();
const iconPath = `${process.env.PUBLIC_URL}/icons/icon-${selectedCryptocurrency}.png`;
const priceText = currencyFormatter.format(spotPrice, { code: selectedCurrency }) || "";
return spotPrice >= 0 ? (
<title>{`${cryptocurrencySymbol}: ${priceText}`}</title>
) : (
<title>{process.env.REACT_APP_NAME}</title>
);
};
const fcurrency = p => p.currency === 'BTC' ? `${btc2milli(p.amount, true)} mBTC`
: CurrencyF.format(p.amount, { code: p.currency })
output += `
${projectInfo}
${new Array(projectInfo.length + 1).join('-')}
Total Assigned: ${totalAssigned}
Reviewed: ${passed + failed}
Ungradeable: ${ungradeable}
Earned: ${currencyFormatter.format(earned, {code: 'USD'})}
Average Turnaround Time: ${moment.utc(avgTurnaroundTime).format('HH:mm')}\n`;
});
const totalEarned = currencyFormatter.format(report.totalEarned, {code: 'USD'});
output += `\nTotal Earned: ${totalEarned}\n`;
if (report.numberOfDays > 1) {
const dailyAverage = currencyFormatter.format(report.dailyAverage, {code: 'USD'});
output += `Daily Average: ${dailyAverage}\n`;
}
output += '=============================================';
return output;
}
module.exports = (value, currency) => currencyFormatter.format(value, { code: currency });
const PriceDetails = ({ currency, priceDifference, percentDifference }) => {
const formattedPriceDifference = currencyFormatter.format(Math.abs(priceDifference), { code: currency });
const formattedPercentDifference = Math.abs(percentDifference).toFixed(2);
if (priceDifference > 0) {
return (
<div>
{`${formattedPriceDifference} (${formattedPercentDifference}%)`}
</div>
);
}
return (
<div>
{`${formattedPriceDifference} (${formattedPercentDifference}%)`}
</div>