From 7c4e0a7c598d823f00fae48b139eb16abef70575 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sat, 9 Mar 2019 10:33:42 -0500 Subject: Complete re-write --- print.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 print.go (limited to 'print.go') diff --git a/print.go b/print.go new file mode 100644 index 0000000..2a39c71 --- /dev/null +++ b/print.go @@ -0,0 +1,21 @@ +package stats + +import ( + "fmt" +) + +// Prints each calculated statistic on a line with one tab preceding it +func (s *Stats) PrettyStats() string { + return fmt.Sprintf(` + Mean: %.2f + Variance: %.2f + Standard Deviation: %.2f + Skewness: %.2f + Kurtosis: %.2f +`, s.Mean(), s.Variance(), s.StandardDeviation(), s.Skewness(), s.Kurtosis()) +} + +// Returns a string containing all of the data within the struct +func (s *Stats) Internals() string { + return fmt.Sprintf("%#v", s) +} -- cgit v1.2.3