Default to '$' symbol if data is missing, add more currencies

master
user.name 5 years ago
parent e7062445f4
commit d7a0153542
  1. 16
      layout.go

@ -296,14 +296,18 @@ func currency(str... string) string {
if len(str) < 2 { if len(str) < 2 {
return "ERR" return "ERR"
} }
//default to $
symbol := "$" symbol := "$"
switch (str[1]){ switch (str[1]){
case "EUR": case "JPY":
symbol = "€" symbol = "¥"
break break
case "GBP": case "EUR":
symbol = "£" symbol = "€"
break break
case "GBP":
symbol = "£"
break
} }
if str[0] == `N/A` || len(str[0]) == 0 { if str[0] == `N/A` || len(str[0]) == 0 {
return `-` return `-`

Loading…
Cancel
Save