mirror of
https://github.com/golang/go
synced 2024-11-21 21:14:47 -07:00
fix up YB and add ZB, EB in example
R=rsc CC=golang-dev https://golang.org/cl/183107
This commit is contained in:
parent
ca0def6659
commit
c05f86a46a
@ -1360,6 +1360,8 @@ const (
|
|||||||
GB
|
GB
|
||||||
TB
|
TB
|
||||||
PB
|
PB
|
||||||
|
EB
|
||||||
|
ZB
|
||||||
YB
|
YB
|
||||||
)
|
)
|
||||||
</pre>
|
</pre>
|
||||||
@ -1373,6 +1375,10 @@ func (b ByteSize) String() string {
|
|||||||
switch {
|
switch {
|
||||||
case b >= YB:
|
case b >= YB:
|
||||||
return fmt.Sprintf("%.2fYB", b/YB)
|
return fmt.Sprintf("%.2fYB", b/YB)
|
||||||
|
case b >= ZB:
|
||||||
|
return fmt.Sprintf("%.2fZB", b/ZB)
|
||||||
|
case b >= EB:
|
||||||
|
return fmt.Sprintf("%.2fEB", b/EB)
|
||||||
case b >= PB:
|
case b >= PB:
|
||||||
return fmt.Sprintf("%.2fPB", b/PB)
|
return fmt.Sprintf("%.2fPB", b/PB)
|
||||||
case b >= TB:
|
case b >= TB:
|
||||||
|
Loading…
Reference in New Issue
Block a user