Link to home
Start Free TrialLog in
Avatar of Member_2_5194534
Member_2_5194534

asked on

Problem(s) with Math.Round

I have this function and i want to return the Rounded (to nearest 1MB) of it...

private static string EstimatedFileSize(double videoBtr_Mbits, uint audioBtr_Kbits, uint video_length_sec)
        {
            // Video Bitrate = [Video Bitrate (Kilobits/Sec) + Audio Bitrate (Kilobits/Sec)]
            var videoBtr_Sum = (uint)((videoBtr_Mbits * 1024) + audioBtr_Kbits);

            // File size = Video Bitrate (Kilobits) * Video Length (Seconds) => kbytes
            var fSize_kbyte = ((videoBtr_Sum * video_length_sec) / 8) * 1024;
            
           return CommonUtility.FileSizeToString(fSize_kbyte.ToString());
        }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of HooKooDooKu
HooKooDooKu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial