I’m very new at this and have a dataset that contains some number values. The dataset is linked to a Table output using code following a query. I want some of the numbers to format as currency in the table, at the moment they appear just as they are in the dataset. The ‘query code’ is below:
wixData.query(“ProductDetail”)
.ascending(“priceGbUs”)
.contains(“coverage”,$w(“#input3”).value)
.find()
.then(res => {
if (wixWindow.formFactor === “Desktop”){
$w(“#table1”).rows = res.items;
$w(“#table1”).expand();
}
if (wixWindow.formFactor === “Mobile”){
$w(“#table4”).rows = res.items;
$w(“#table4”).expand();
}
});
The table columns are set up in the typical way as below:
$w(“#table1”).columns = [{
“id”:“col1”,
“dataPath”: “title”,
“label”: “Provider”,
“type”: “string”,
“width”: 120,
}, {
“id”: “col2”,
“dataPath”: “link”,
“label”: “Link”,
“type”: ‘string’,
“width”: 220,
“visible”: false ,
}, {
“id”: “col2”,
“dataPath”: “additionalInfo1”,
“label”: “Additional Info 1”,
“type”: ‘string’,
“width”: 220,
“visible”: false ,
}, {
“id”: “col2”,
“dataPath”: “image”,
“label”: “Image”,
“type”: ‘image’,
“width”: 220,
“visible”: false ,
}, {
“id”: “col2”,
“dataPath”: “buyLink”,
“label”: “Buy Link”,
“type”: ‘string’,
“width”: 220,
“visible”: false ,
}, {
“id”: “col3”,
“dataPath”: “planName”,
“label”: “Plan Name”,
“type”: “string”,
“width”: 220,
}, {
“id”: “col4”,
“dataPath”: “dataGb”,
“label”: “Data (GB)”,
“type”: “number”,
“width”: 130,
}, {
“id”: “col5”,
‘dataPath’: ‘validityDays’,
‘label’: ‘Validity (Days)’,
‘type’: ‘number’,
“width”: 130,
}, {
‘id’: ‘col6’,
‘dataPath’: ‘priceUs’,
‘label’: ‘Price ($US)’,
‘type’: ‘number’,
“width”: 130,
}, {
‘id’: ‘col6’,
‘dataPath’: ‘priceGbUs’,
‘label’: ‘Price/GB ($US)’,
‘type’: ‘number’,
“width”: 150,
}]
Would appreciate any assistance.