Changeset 509e39b


Ignore:
Timestamp:
Feb 17, 2018 3:34:17 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
cd351592
Parents:
dd57531
Message:

Console: Number format tweaks (ticket #1913)

Location:
apps/routerconsole/java/src/net/i2p/router/web/helpers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryHelper.java

    rdd57531 r509e39b  
    533533            return "0";
    534534        long received = _context.bandwidthLimiter().getTotalAllocatedInboundBytes();
    535         return DataHelper.formatSize2(received) + 'B';
     535        return DataHelper.formatSize2Decimal(received) + 'B';
    536536    }
    537537
     
    545545            return "0";
    546546        long sent = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
    547         return DataHelper.formatSize2(sent) + 'B';
     547        return DataHelper.formatSize2Decimal(sent) + 'B';
    548548    }
    549549
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/TunnelRenderer.java

    rdd57531 r509e39b  
    143143            else
    144144                out.write("<td class=\"cells\" align=\"center\">(" + _t("grace period") + ")</td>");
    145             out.write("<td class=\"cells\" align=\"center\">" + count + " KB</td>");
     145            out.write("<td class=\"cells\" align=\"center\">" + (count * 1024 / 1000) + " KB</td>");
    146146            int lifetime = (int) ((_context.clock().now() - cfg.getCreation()) / 1000);
    147147            if (lifetime <= 0)
     
    167167        else if (displayed <= 0)
    168168            out.write("<div class=\"statusnotes\"><b>" + _t("none") + "</b></div>\n");
    169         out.write("<div class=\"statusnotes\"><b>" + _t("Lifetime bandwidth usage") + ":&nbsp;&nbsp;" + DataHelper.formatSize2(processed*1024) + "B</b></div>\n");
     169        out.write("<div class=\"statusnotes\"><b>" + _t("Lifetime bandwidth usage") + ":&nbsp;&nbsp;" + DataHelper.formatSize2Decimal(processed*1024) + "B</b></div>\n");
    170170        } else {
    171171            out.write("<div class=\"statusnotes noparticipate\"><b>" + _t("Not enough shared bandwidth to build participating tunnels.") +
     
    248248                          _t("Outbound") + "\"></td>");
    249249            out.write("<td class=\"cells\" align=\"center\">" + DataHelper.formatDuration2(timeLeft) + "</td>\n");
    250             int count = info.getProcessedMessagesCount();
    251             out.write("<td class=\"cells\" align=\"center\">" + count + " KiB</td>\n");
     250            int count = info.getProcessedMessagesCount() * 1024 / 1000;
     251            out.write("<td class=\"cells\" align=\"center\">" + count + " KB</td>\n");
    252252            for (int j = 0; j < info.getLength(); j++) {
    253253                Hash peer = info.getPeer(j);
     
    298298            out.write("<div class=\"statusnotes\"><center><b>" + _t("No tunnels; waiting for the grace period to end.") + "</b></center></div>\n");
    299299        out.write("<div class=\"statusnotes\"><center><b>" + _t("Lifetime bandwidth usage") + ":&nbsp;&nbsp;" +
    300                   DataHelper.formatSize2(processedIn*1024) + "B " + _t("in") + ", " +
    301                   DataHelper.formatSize2(processedOut*1024) + "B " + _t("out") + "</b></center></div>");
     300                  DataHelper.formatSize2Decimal(processedIn*1024) + "B " + _t("in") + ", " +
     301                  DataHelper.formatSize2Decimal(processedOut*1024) + "B " + _t("out") + "</b></center></div>");
    302302    }
    303303
Note: See TracChangeset for help on using the changeset viewer.