Would anyone be able to tell me where this goes? My coding knowledge is minimal.
I’m looking to change a text field thats pulling info from a collection, to a currency format. Currently it displays as a number (no $, or commas).
I know this is an old post but i’m running out of options. Thanks in advance!
@jonatandor35 Thanks J.D.
I’ve currently got this code
export function propertiesRepeater_itemReady ( $item , itemData , index ) { let currentPrice = itemData.price ; let newPrice = “$” + formatNumber_AsDollar ( currentPrice );
$item ( “#price” ). text = newPrice ;
let currentSQFT = itemData.size ; let newSQFT = ( currentSQFT ) + " SQFT" ;
$item ( “#text7” ). text = newSQFT ;
}
function formatNumber_AsDollar ( x ) { return x . toString (). replace (/\B(?=(\d{3})+(?!\d))/ g , “,” );
}
This corrects the displayed number/text to a currency format for items within the repeater.
What I’m aiming to to do is have the same adjustment happen to the price field on the “Title” page of the repeater (the page that loads after a user clicks on an item in the repeater). On this page I have a text field (#price) that is pulling info from a dynamic dataset. This is the field that I would need to target with your java code from above.
I hope that helps clear things up a bit. Let me know if you have any other questions. Thanks for your quick response J.D.