hi i'm trying to convert the users input from dollars to cents. every time it just prints exactly what i typed in, so if i enter 0.20, the output is 0.200000. my math.h seems to be having no effect but i cannot see why.
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int main(void)
{
float dollars;
int counter;
int change;
do
{
dollars = get_float("How much change? "); //prompts for amount of change
}
while (dollars < 0); //checks for positive sum
change = roundf(dollars * 100);
printf("%i\n", change);
}