diff --git a/du3/program.c b/du3/program.c index f22d8db..e87a1cf 100644 --- a/du3/program.c +++ b/du3/program.c @@ -29,23 +29,23 @@ int main(){ char *end = NULL; char *start = pol; x=strtof(start,&end); + x=round(x*100)/100; + start=end; float num=0; for(int i=0;i0;idx--)p*=x; num+=p*n; } - num*=100; - num=round(num); - num/=100; + num=round(num*100)/100; printf("Vysledok je: %.2f\n", num); return EXIT_SUCCESS;