Skip to Content
0
Jun 04, 2020 at 11:47 AM

How to display numbers as comma separated value in thousands

1136 Views

Dear Community,

On the table, one of the column value, I have to display it in comma separated values like 1001 means 1,001. The value is not a currency related. So currency conversion is not required. It is about production quantity.

My view.xml for the column is as below:

<t:Column>

<Label text="{i18n>label.quantity}" design="Bold" wrapping="false"/>

<Text text="{path: 'tableModel>QTY_TO_BUILD', formatter: '.formatter.getQtyFormatted'}" wrapping="false"/>

</t:template>

</t:Column>

In the above, I am using getQtyFormatted function.

Please let me know what code i should have in my formatter.js so that when ever value to be displayed, i can format and display.