fixed8: remove trailing zeroes from string representation

Add some testcases from `dev` branch (with less than zero case added) and
remove useless trailing zeroes from the resulting string.
This commit is contained in:
Roman Khimov 2019-08-23 13:15:09 +03:00
parent d5d570f793
commit c67217159f
3 changed files with 3 additions and 3 deletions

View file

@ -34,7 +34,7 @@ func (f Fixed8) String() string {
for i := len(str); i < 8; i++ {
buf.WriteRune('0')
}
buf.WriteString(str)
buf.WriteString(strings.TrimRight(str, "0"))
}
return buf.String()
}