View Single Post
Old 08-25-2019, 02:38 PM   #1
China Diapers
Member
China Diapers began at the beginning.
 
Posts: 21
Karma: 10
Join Date: May 2011
Device: PRS-600
Help with test template formula

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:	161
Size:	17.2 KB
ID:	173120  

Last edited by China Diapers; 08-25-2019 at 03:23 PM.
China Diapers is offline   Reply With Quote