utils

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ESC = "\033"

ESC is the escape string.

Variables

This section is empty.

Functions

func Bold

func Bold(s string) string

Bold makes a string bold.

func Capitalize

func Capitalize(str string) string

Capitalize a string.

func Color

func Color(s string, d Direction) string

Color formats a string according to price direction.

func DateF

func DateF(q *finance.Quote) string

DateF returns a formatted date string from a quote.

func MktStateF

func MktStateF(m finance.MarketState) string

MktStateF formats market state.

func NumberF

func NumberF(i int) string

NumberF formats a big number with commas.

func Strip

func Strip(s string) string

Strip strips weird html strings.

func ToInt

func ToInt(value string) int

ToInt converts a string to an int.

func ToString

func ToString(v int) string

ToString converts an int to a string.

func ToStringF

func ToStringF(v float64) string

ToStringF converts an int to a string.

Types

type Direction

type Direction int

Direction is a price direction.

const (
	Flat Direction = iota
	Down
	Up
)

func PriceDirection

func PriceDirection(q *finance.Quote) Direction

PriceDirection returns a plus/minus indicating price direction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL