# Numeral JS custom formatter in TSVB

**URL:** https://discuss.elastic.co/t/numeral-js-custom-formatter-in-tsvb/112576
**Category:** Kibana
**Created:** [December 20, 2017, 7:58am UTC](https://discuss.elastic.co/t/numeral-js-custom-formatter-in-tsvb/112576 "2017-12-20T07:58:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Shubham\_Mahajan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shubham_mahajan/32/22140_2.png) [@Shubham\_Mahajan](https://discuss.elastic.co/u/Shubham_Mahajan)
#### Post date: [December 20, 2017, 7:58am UTC](https://discuss.elastic.co/t/numeral-js-custom-formatter-in-tsvb/112576/1 "2017-12-20T07:58:15Z")

</div>

Hi guys,  
Here in metric tab of Visual Builder (TSVB), i want to return String on the basis of the returned metric using numeral js in custom formatter. Please help!!!  
This is what I'm trying to do -\> `When passed metric is 0, return this string or else other string.` Is it possible to do that??

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

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [December 20, 2017, 5:23pm UTC](https://discuss.elastic.co/t/numeral-js-custom-formatter-in-tsvb/112576/2 "2017-12-20T17:23:50Z")

</div>

The `Format String` input allows users to specify a [numeral.js format string](http://numeraljs.com/#format) that can be used to format the number. The format string is not code and does not support if/else logic.

---

<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: [January 17, 2018, 5:23pm UTC](https://discuss.elastic.co/t/numeral-js-custom-formatter-in-tsvb/112576/3 "2018-01-17T17:23:58Z")

</div>

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