import React from "react";

interface IProps {
  value: number | string;
  unit?: string;
}
const Price: React.FC<IProps> = ({ value, unit }) => {
  const text = value.toString();
  const [before, after = "00"] = text.split(".");

  return (
    <span>
      {before}
      <small>
        . {after} {unit && <small>{unit}</small>}
      </small>
    </span>
  );
};

export default Price;
