Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 50094

Help with test template formula

$
0
0
I have created the below template:

program:format_number(test(field('#duration'),divi de(field('#page_count'),field('#duration')),0),"{0 :5.1f}");

What I was intending it would do is return 0 where the 'duration' field is blank (thereby avoiding division by zero) else the quotient of page count divided by duration value.

What is actually happening is the result is never 0, it is either the quotient or a division by zero error, so it appears the test is ignored or I am misunderstanding the purpose of the test function.

Screenshot attached for context.

Any ideas?

Attached Thumbnails
Click image for larger version

Name:	Screenshot_2019-08-25_19-32-14.png
Views:	N/A
Size:	17.2 KB
ID:	173120  

Viewing all articles
Browse latest Browse all 50094

Latest Images

Trending Articles



Latest Images