|
|
@ -36,9 +36,9 @@ func (self *Layout) Initialize() *Layout { |
|
|
|
{ 10, `52w High` }, |
|
|
|
{ 10, `52w High` }, |
|
|
|
{ 11, `Volume` }, |
|
|
|
{ 11, `Volume` }, |
|
|
|
{ 11, `AvgVolume` }, |
|
|
|
{ 11, `AvgVolume` }, |
|
|
|
{ 10, `P/E` }, |
|
|
|
{ 9, `P/E` }, |
|
|
|
{ 10, `Dividend` }, |
|
|
|
{ 9, `Dividend` }, |
|
|
|
{ 10, `Yield` }, |
|
|
|
{ 9, `Yield` }, |
|
|
|
{ 11, `MktCap` }, |
|
|
|
{ 11, `MktCap` }, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -186,9 +186,8 @@ func arrow_for(column int, profile *Profile) string { |
|
|
|
if column == profile.SortColumn { |
|
|
|
if column == profile.SortColumn { |
|
|
|
if profile.Ascending { |
|
|
|
if profile.Ascending { |
|
|
|
return string('\U00002191') |
|
|
|
return string('\U00002191') |
|
|
|
} else { |
|
|
|
|
|
|
|
return string('\U00002193') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return string('\U00002193') |
|
|
|
} |
|
|
|
} |
|
|
|
return `` |
|
|
|
return `` |
|
|
|
} |
|
|
|
} |
|
|
@ -197,50 +196,48 @@ func arrow_for(column int, profile *Profile) string { |
|
|
|
func blank(str string) string { |
|
|
|
func blank(str string) string { |
|
|
|
if len(str) == 3 && str[0:3] == `N/A` { |
|
|
|
if len(str) == 3 && str[0:3] == `N/A` { |
|
|
|
return `-` |
|
|
|
return `-` |
|
|
|
} else { |
|
|
|
|
|
|
|
return str |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return str |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
func blank_currency(str string) string { |
|
|
|
func blank_currency(str string) string { |
|
|
|
if str == `0.00` { |
|
|
|
if str == `0.00` { |
|
|
|
return `-` |
|
|
|
return `-` |
|
|
|
} else { |
|
|
|
|
|
|
|
return currency(str) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return currency(str) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
func last(str string) string { |
|
|
|
func last(str string) string { |
|
|
|
if len(str) >= 6 && str[0:6] != `N/A - ` { |
|
|
|
if len(str) >= 6 && str[0:6] != `N/A - ` { |
|
|
|
return str |
|
|
|
return str |
|
|
|
} else { |
|
|
|
|
|
|
|
return str[6:] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return str[6:] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
func currency(str string) string { |
|
|
|
func currency(str string) string { |
|
|
|
if str == `N/A` { |
|
|
|
if str == `N/A` { |
|
|
|
return `-` |
|
|
|
return `-` |
|
|
|
} else { |
|
|
|
|
|
|
|
switch str[0:1] { |
|
|
|
|
|
|
|
case `+`, `-`: |
|
|
|
|
|
|
|
return str[0:1] + `$` + str[1:] |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return `$` + str |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if sign := str[0:1]; sign == `+` || sign == `-` { |
|
|
|
|
|
|
|
return sign + `$` + str[1:] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return `$` + str |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
func percent(str string) string { |
|
|
|
func percent(str string) string { |
|
|
|
if str == `N/A` { |
|
|
|
if str == `N/A` { |
|
|
|
return `-` |
|
|
|
return `-` |
|
|
|
} else { |
|
|
|
|
|
|
|
return str + `%` |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return str + `%` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|