How can I use this to show a dollar-sign: [[ (Math.random().slice(3,10) *.01).toLocaleString() ]]

Hey all,

How can I add a dollar-sign to this: [[ (Math.random().slice(3,10) *.01).toLocaleString(“US”,“USD”) ]]

I know I can just add a “$” outside the brackets, but I’m wondering if I can leverage/populate inside the () that follows .toLocaleString.

I tried various forms of .toLocaleString(“us”,“USD”), but they didn’t work. :frowning:

Thanks!

I’m pretty sure the .toLocaleString method here is the one found on the Number object. Here’s the documentation:

The only arguments it supports looks to be for different numbering systems, not currency. Your initial idea of putting it outside the brackets is generally the best way to do it.

Is the a reason or a need you have why that doesn’t work for you?

You can concatenate multiple formulas & text using [[ ]] brackets. Perhaps using the formula twice and taking the last couple characters could allow you to insert a $

Example: