doubt related to window function in sql

– Q.3 Write a query to show the overall progress percentage in terms of films length watched after watching each film.

SELECT  film_id,
        title,
        length,
        SUM(length) OVER (ORDER BY film_id) *100.0 / SUM(length) OVER() running_percent
FROM film

while i do this question it will give output

image

BUT when i change 100.0 to 100 then output will be

SELECT  film_id,
        title,
        length,
        SUM(length) OVER (ORDER BY film_id) *100 / SUM(length) OVER() running_percent
FROM film

image

why this changes happen?

If you see the type of running percent in 2nd query. the percentage gets truncated into int format which is not happening in the first case where you used a float to calculate percentage.