# Vega Viz - Displaying data in Bytes

**URL:** https://discuss.elastic.co/t/vega-viz-displaying-data-in-bytes/154929
**Category:** Kibana
**Created:** [October 31, 2018, 9:29pm UTC](https://discuss.elastic.co/t/vega-viz-displaying-data-in-bytes/154929 "2018-10-31T21:29:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nyssa](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nyssa](https://discuss.elastic.co/u/nyssa)
#### Post date: [October 31, 2018, 9:29pm UTC](https://discuss.elastic.co/t/vega-viz-displaying-data-in-bytes/154929/1 "2018-10-31T21:29:52Z")

</div>

Goal : Need to display data in Bytes.

I am trying to use numeral.js on Kibana for a vega viz but am not able to get the data to display in bytes. This is the library [http://numeraljs.com/](http://numeraljs.com/) and this is my signal

"signal": "if(cell\_hover && cell\_hover.datum.metric.value & \> 0, format(cell\_hover.datum.metric.value,'0.0b'), "")"

and its resulting in this

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/e/be137d602095ac55711c90e309c5de30203aecb8.png)

If there are any vega/js experts out there that can help me, i would very much appreciate it.

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [October 31, 2018, 10:16pm UTC](https://discuss.elastic.co/t/vega-viz-displaying-data-in-bytes/154929/2 "2018-10-31T22:16:20Z")

</div>

hi @nyssa

On first glance, doesn't it kind of do what it needs to? I believe the `b` type shows a binary-string, rounded to the nearest integer (I don't think decimal notation will work here).

---

<div class="post-metadata">

### Author: ![nyssa](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nyssa](https://discuss.elastic.co/u/nyssa)
#### Post date: [November 1, 2018, 4:58pm UTC](https://discuss.elastic.co/t/vega-viz-displaying-data-in-bytes/154929/3 "2018-11-01T16:58:49Z")

</div>

@thomasneirynck hmmmm you're right that makes sense, do you know what would be the format for bytes then?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 29, 2018, 4:59pm UTC](https://discuss.elastic.co/t/vega-viz-displaying-data-in-bytes/154929/4 "2018-11-29T16:59:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
