Selaa lähdekoodia

Updated readme

Signed-off-by: Vishal Rana <vr@labstack.com>
Vishal Rana 10 vuotta sitten
vanhempi
commit
2843abeff0
2 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa
  1. 11 1
      gytes/README.md
  2. 1 0
      gytes/gytes_test.go

+ 11 - 1
gytes/README.md

@@ -33,11 +33,21 @@ fmt.Println(gytes.Format(1323))
 
 ### New intance
 
+#### Decimal prefix 
+
 ```go
 g := New()
-// g.BinaryPrefix(true)
 fmt.Println(g.Format(13231323))
 ```
 
 `13.23 MB`
 
+#### Binary prefix
+
+```go
+g := New()
+g.BinaryPrefix(true)
+fmt.Println(g.Format(13231323))
+```
+
+`12.62 MiB`

+ 1 - 0
gytes/gytes_test.go

@@ -39,6 +39,7 @@ func TestNew(t *testing.T) {
 
 	// Binary prefix
 	g.BinaryPrefix(true)
+	println(g.Format(13231323))
 	b = Format(1323132313231323)
 	if b != "1.18 PiB" {
 		t.Errorf("expected `1.18 PiB`, got %s", b)