diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2019-03-09 10:38:17 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2019-03-09 10:38:17 -0500 |
| commit | 46f933fbac76630016e96aeb1f434cdd09ec3aa8 (patch) | |
| tree | 9fd8535bcc09ab7f462ae120fbdd52fcfe7d9d12 /print.go | |
| parent | 9904322b0cf7e1b98a5d7cb9ffc8453edcca83b1 (diff) | |
| download | stats-46f933fbac76630016e96aeb1f434cdd09ec3aa8.tar.gz stats-46f933fbac76630016e96aeb1f434cdd09ec3aa8.tar.xz | |
Merge working development into master
Diffstat (limited to 'print.go')
| -rw-r--r-- | print.go | 21 |
1 files changed, 21 insertions, 0 deletions
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) +} |
