A string is input as a fraction, how can I convert this string to float?

In the below code it always show the first number only without any calculations i.e : 2.00

```
int main (void)
{
    string fraction = "2/4";
    float sum = atof(fraction);
    printf("sum : %.2f\n",sum);
    return 0;
}

```