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 (
    <span>
      {totalAmount.split('.')[0]},{totalAmount.split('.')[1]}
      {!hideCurrency && currency}
    </span>
  );
};

export default Price;
