From fa555e77be07ef4bfb6e5fda8018a71896b11c19 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 17 Jun 2017 18:17:35 +0100 Subject: [PATCH] tweaks to block size formatting in block size chart. --- src/Template/Main/blocks.ctp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Template/Main/blocks.ctp b/src/Template/Main/blocks.ctp index 9d64a78..a804c16 100644 --- a/src/Template/Main/blocks.ctp +++ b/src/Template/Main/blocks.ctp @@ -156,7 +156,7 @@ axisColor: '#1e88e5', axisThickness: 2, labelFunction: function(value) { - return (Math.round((value / 1000) * 100)/100) + ' KB'; + return (Math.round((value / 1000) * 100)/100).toFixed(2) + ' KB'; } }, { @@ -222,7 +222,7 @@ switchable: false, balloonFunction: function(item, graph) { var result = graph.balloonText; - return result.replace('[[AvgBlockSize]]', Math.round((item.dataContext.AvgBlockSize / 1000) * 100)/100); + return result.replace('[[AvgBlockSize]]', (Math.round((item.dataContext.AvgBlockSize / 1000) * 100)/100).toFixed(2)); } }, { @@ -274,7 +274,7 @@ if (item.dataContext) { var g = item.graph; if (g.id === 'g-block-size' && item.dataContext.AvgBlockSize > 0) { - return g.balloonText.replace('[[AvgBlockSize]]', Math.round((item.dataContext.AvgBlockSize / 1000) * 100)/100); + return g.balloonText.replace('[[AvgBlockSize]]', (Math.round((item.dataContext.AvgBlockSize / 1000) * 100)/100).toFixed(2) ); } if (g.id === 'g-price' && item.dataContext.AvgUSD) { return g.balloonText.replace('[[AvgUSD]]', item.dataContext.AvgUSD.toFixed(2));