Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jofftiquez committed May 13, 2020
1 parent 2197bc9 commit deb064d
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,18 @@ All formats are available of course in the [date-fns format documentation](https

> `import { morphFileSize } from 'vue-morphling';`
Converts any number (as bytes) to it's equivalent, `Kb`, `Mb`, `Gb`, `Tb`, `Pb`, `Eb`, `Zb` and `Yb`.
Converts any number (as bytes) to it's equivalent, `KB`, `MB`, `GB`, `TB`, `PB`, `EB`, `ZB` and `YB`.

**Options**

For setting decimal places use `{ base: number }`. More options [here](https://www.npmjs.com/package/filesize#optional-settings).

```html
<code>{{ 1024 | morph-file-size }}</code>
<!-- 1.0 Kb -->
<code>{{ 1024 | morph-file-size({ base: 0 }) }}</code>
<!-- 1 KB -->

<p>{{ 10000000000 | morph-file-size }}</p>
<!-- 9.3 Gb -->
<!-- 9.30 GB -->
```

```javascript
Expand Down Expand Up @@ -355,14 +359,18 @@ console.log(msg); // lost in the echo

> `import { morphObjectSize } from 'vue-morphling';`
Gets the bytes size (number) of any javascript object and converts it to it's equivalent `Kb`, `Mb`, `Gb`, `Tb`, `Pb`, `Eb`, `Zb` and `Yb`.
Gets the bytes size (number) of any javascript object and converts it to it's equivalent `KB`, `MB`, `GB`, `TB`, `PB`, `EB`, `ZB` and `YB`.

**Options**

For setting decimal places use `{ base: number }`. More options [here](https://www.npmjs.com/package/filesize#optional-settings).

```html
<code>{{ obj1 | morph-object-size }}</code>
<!-- 18.0 b -->
<code>{{ obj1 | morph-object-size({ base: 0 }) }}</code>
<!-- 18 B -->

<p>{{ `Forget the wrong the i've done.` | morph-object-size }}</p>
<!-- 33.0 b -->
<p>{{ `Forget the wrong the i've done.` | morph-object-size({ base: 2 }) }}</p>
<!-- 33.00 B -->
```

```javascript
Expand Down

0 comments on commit deb064d

Please sign in to comment.