export interface PriceProps { amount: string; hideCurrency?: boolean; currency?: string; } const Price = (props: PriceProps): JSX.Element => { const { hideCurrency = false, amount, currency } = props; const totalAmount = parseFloat(amount).toFixed(2); return ( {totalAmount.split('.')[0]},{totalAmount.split('.')[1]} {!hideCurrency && currency} ); }; export default Price;