Quote:
Originally Posted by ownedbycats
What would be the best way to turn this into templates for the KoboTouch read estimates?
Code:
HoursMax = round(WordCount / 200 / 60)
HoursMin = HoursMax - 1
if (HoursMax >= 10) {
HoursMax += round((HoursMax + .5) / 10) - 1)
}
I managed to get this so far, but my brain isn't cooperating at the moment
Code:
program: round(divide(divide($#wordcount, 200), 60))
|
Note that the code you want translated has unbalanced parentheses on line 4. I removed the one after '-1'.
Code:
program:
HoursMax = round($$#wordcount / 200 / 60);
HoursMin = HoursMax - 1;
if (HoursMax >= 10) then
HoursMax = HoursMax + round((HoursMax + .5) / 10) - 1
fi
The template language doesn't do constant folding so for performance the first HoursMax line should be written
Code:
HoursMax = round($$#wordcount / 12000);