Skip to content

Instantly share code, notes, and snippets.

@yeukhon
Created August 12, 2018 19:35
Show Gist options
  • Save yeukhon/60a4475c824d7597665a3097cd18b4f4 to your computer and use it in GitHub Desktop.
Save yeukhon/60a4475c824d7597665a3097cd18b4f4 to your computer and use it in GitHub Desktop.
// NOTE: Ideally we want this kind of output, rather than hardcoing slicing up to 6 chars.
// fmt.Printf("%-13.4f\n", RedIt(StrToNum(stock.Open) - StrToNum(stock.Price)))
// fmt.Printf("%-13s\n", "\x1b[31;1m" + stock.Price + "\x1b[0m")
// I get multiple-value fmt.Printf() in single-value context if:
// fmt.Printf("%-13s\n", "\x1b[31;1m" + fmt.Sprint(fmt.Printf("%.4f", "num)) + "\x1b[0m")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment