How to calculate percentage in c# -
i trying calculate percentage of given long value. following code returning 0 . how calculate percentage in c#
long value = (fsize / tsize) * (long)100;
here fsize , tsize long values.
try this
var value = ((double)fsize / tsize) * 100; var percentage = convert.toint32(math.round(value, 0));
Comments
Post a Comment