Paste #45052: Untitled Paste

Date: 2017/10/18 18:16:26 UTC-07:00
Type: Server Log

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17


        registerTag("count", new TagRunnable() {
            @Override
            public String run(Attribute attribute, dObject object) {
                dList list = new dList((dList) object);
                double sum = 0;
                try {
                    for (int i = 0; i < list.size(); i++) {
                        sum = sum + Double.parseDouble(list.get(i));
                }
                catch (Exception ex) {
                    dB.echoError("The tag li@list.sum contains a invalid number!");
                    return null;
                }
                return new Element(sum).getAttribute(attribute.fulfill(1));
            }
        });