Style data in a SmartTable

How do I style data in my SmartTable?

For example, I have a smart table that is linked to AirTables as my database. Within Airtables, my currency columns are the result of calculations that are then formatted in AirTables as Currency.

Then I’ve pulled my data from Airtables into my Smart Table in AirTables, but I only have the option to format this as a decimal. Is there a no-code way to style this data as a currency?

@TimTim! I believe you can try a JS function called Numeral.JS this function allows editing the data in different formats.
About Numer JS you can read here.
To connect the Numeral JS function to your project you need to open the project settings


In the tab code put the link to Numeral JS function - <script src="//cdnjs.cloudflare.com/ajax/libs/numeral.js/2.0.6/numeral.min.js"></script>
And save changes

Almost done.
Now we need to use the Numeral JS function, to do this use syntaxis like {{numeral(state.number).format('$0,0.00')}} , where {{ }} - our call to variable, state.number - name of the variable, format(’$0,0.00’) - desired format of numbers.

Click on the preview button to see the result

PS looks like this suggestion may format all data formats. But you can try another way with simple table.

Hi Artem - I’m having some trouble with this inserting the data. Here’s the code in my data area. Can you tell me what I’m doing wrong?

I’m trying to load a row but then when I do that I can’t return the data in the id: 2

hi @TimTim! Could you please share the request you made? And maybe you forgot to run your action?
Also, you cantest what do you receive, Just use a Code step with the following code:

console.log({{data}});
return {{data}};