Function fracToDec

  • Convert fraction to decimal number

    Parameters

    • frac: string

      Fraction to convert

    Returns number

    Faction as a decimal

    fracToDec('1 1/4') // Outputs: 1.25