From de254614944ee5c82656a42e63fc1eaf644a1902 Mon Sep 17 00:00:00 2001 From: Joe Uhren Date: Fri, 14 Oct 2022 13:13:46 -0600 Subject: [PATCH] Improve network chart precision -Chart.js numbers are rounded to 3 decimals by default. This fix uses the raw value instead of the formatted number for display on the network hashrate and difficulty charts so that low numbers like 0.00028363 are displayed properly instead of being rounded to 0 --- views/layout.pug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/layout.pug b/views/layout.pug index d8f24d3..61689ab 100644 --- a/views/layout.pug +++ b/views/layout.pug @@ -448,7 +448,7 @@ html(lang='en') return 'Block ' + context[0].label + ' Hashrate'; }, label: function(context) { - return context.formattedValue + ' ' + getNetHashUnits() + return (context.raw || 0).toString() + ' ' + getNetHashUnits() } } }, @@ -554,7 +554,7 @@ html(lang='en') return 'Block ' + context[0].label + ' Difficulty'; }, label: function(context) { - return context.formattedValue; + return (context.raw || 0).toString(); } } },