Try this:
Code:
program:
read = raw_field('#pages_read');
total = raw_field('#total_pages');
# if total <= 0 (or undefined), set read to 0
read = cmp(total, 0, 0, 0, read);
# make sure the dividend (total) != 0
total = cmp(total, 0, 1, 1, total);
percent = multiply(divide(read, total), 100);
cmp(percent, 0, '', '', format_number(percent, "{0:2d}"))
The custom column definition looks like this: