diff --git a/README.md b/README.md index 13a6aff..4a51be1 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,7 @@ Done: To (possibly) do: +- [ ] Consider adding an understanding of percentages - [ ] With the -f command line option, the program doesn't read from stdin after finishing reading the file - [ ] Add functions. Now easier to do with an explicit representation of the stakc - [ ] Think about how to draw a histogram from samples diff --git a/pretty/pretty.go b/pretty/pretty.go index 1546f51..3e6eb79 100644 --- a/pretty/pretty.go +++ b/pretty/pretty.go @@ -72,6 +72,8 @@ func ParseFloat(word string) (float64, error) { n := len(word) - 1 f, err := strconv.ParseFloat(word[:n], 64) switch word[n] { + case '%': + return multiplyOrPassThroughError(0.01, f, err) case 'K': return multiplyOrPassThroughError(1_000, f, err) case 'M':