From 8d424b748fcf51b4f11d632e2a081d8906da1718 Mon Sep 17 00:00:00 2001 From: Brandon Lee Camilleri Date: Sun, 15 Sep 2019 10:31:06 +0200 Subject: [PATCH] Update layout.go https://github.com/brandleesee/TerminalStocks/commit/34a348528bb09cd55b019ac192613812f74f4695 --- layout.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout.go b/layout.go index 2ac9a44..167f531 100644 --- a/layout.go +++ b/layout.go @@ -274,7 +274,7 @@ func last(str string) string { //----------------------------------------------------------------------------- func currency(str string) string { - if str == `N/A` { + if str == `N/A` || len(str) == 0 { return `-` } if sign := str[0:1]; sign == `+` || sign == `-` { @@ -287,7 +287,7 @@ func currency(str string) string { // Returns percent value truncated at 2 decimal points. //----------------------------------------------------------------------------- func percent(str string) string { - if str == `N/A` { + if str == `N/A` || len(str) == 0 { return `-` }