# Dashboard Table - Mixing Data Types

**URL:** <https://discourse.nodered.org/t/dashboard-table-mixing-data-types/38593>\
**Category:** Dashboard\
**Created:** [5 January 2021 14:07 UTC](https://discourse.nodered.org/t/dashboard-table-mixing-data-types/38593 "2021-01-05T14:07:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave-kinnear](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@dave-kinnear](https://discourse.nodered.org/u/dave-kinnear)\
**Post date:** [5 January 2021 14:07 UTC](https://discourse.nodered.org/t/dashboard-table-mixing-data-types/38593/1 "2021-01-05T14:07:42Z")

</div>

I am trying to create this table on a Node-Red dashboard:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/f/7f557aed38eb2326544e97dbf7c3f43ad67eafd8.png)

I have been through this forum and other online advice and have found only complicated solutions discussing passing arrays to template nodes or ng-repeat (which did not like the strings). I have gotten very close but cannot reproduce the comma separator (due to using using parseFloat to Fixed). See just a couple of the references or examples below.

Is there a straightforward method to mix Strings (the first two columns) and Numbers with different decimal digits in a dynamic table in Node-Red dashboard? I have tried node-red-node-ui-table. Can I use ng-repeat for each row individually and change the format? Can I call each element in my array (msg.payload) individually in the template note code?

It also seems to me that toLocaleString() would solve my issue but I have red a few posts that this does not work with Node-Red. Does anyone know if this has been corrected?

Thanks for any ideas or additional references.

> **[Node-RED Dashboard Template Examples (AngularJS)](https://it.knightnet.org.uk/kb/nr-qa/dashboard-template-examples/)**
>
> Some examples of using AngularJS with the Node-RED Dashboard.
> Not all features of Angular are accessible via the Dashboard.

> [@EXAMPLE (template) - displaying a two dimensional table](https://discourse.nodered.org/t/example-template-displaying-a-two-dimensional-table/662):
>
> Problem: You need to display a table with first name, last name and age. Sample data: Paul Doe, 24 Greg Jones, 31 Able Smith, 29 We will use a function node to create the table like this: And display the table using the template node. Here is what we use in the template node: [09%20AM] In this case we use the ng-repeat twice, once to process each row of the table in the \<tr\> and once to display each item in each row using a \<td\> element. Here is what the display will look li…

---

<div class="post-metadata">

**Author:** ![dave-kinnear](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@dave-kinnear](https://discourse.nodered.org/u/dave-kinnear)\
**Post date:** [5 January 2021 19:10 UTC](https://discourse.nodered.org/t/dashboard-table-mixing-data-types/38593/2 "2021-01-05T19:10:13Z")

</div>

[SOLVED]

I solved it myself by upgrading my Node-Red because earlier versions did not used toLocaleString properly.

Then:

number = number.toLocaleString('en-US', {maximumFractionDigits: 0});

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [19 January 2021 19:10 UTC](https://discourse.nodered.org/t/dashboard-table-mixing-data-types/38593/3 "2021-01-19T19:10:17Z")

</div>

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