Hello All,
Thank you in advance for any replies. This forum has a been a great resource to getting my little widget up and running. I'm not a terribly experienced developer outside of VB so sorry if this is obvious. I searched the forum and didn't really come across a solution.
Basic idea is I'm retrieving a dollar value from an API. I've got this part down, and passed to a variable and formatted to give me 2 decimal points...
My question is there a (preferably easy) way to add thousands separators?
My 'price' is coming through as 4941515.1561531
I'm formatting it to get $ 4941515.16
What I would like for readability is $ 4,941,515.16
Ideas? Thanks everyone!
function onReceivePrice(responseCode, data) { if(responseCode == 200) { Price = data["bpi"]["USD"]["rate_float"].toFloat(); L1 = "$ "+Price.format("%.2f"); L2 = "$ "+(Price*Port).format("%.2f"); //! blah blah blah....