Skip to main content
Inspiring
April 5, 2021
Answered

Placeholder text with a formatted number

  • April 5, 2021
  • 1 reply
  • 2212 views

All of the placeholder text I worked with in form fields has relied on a custom format script, but now I want to have a placholder of 0 for a field I want to be formatted with a currency symbol and commas (but no decimal points). If I use the custom format to achieve the placeholder with an if/else event.value, what code can I add to it to format the text with a dollar sign, commas and no decimals? I suspect it involves util.printf but I'm a little stuck as to how to actually write it.

This topic has been closed for replies.
Correct answer try67

But if I use a custom format script in the format tab in order to achieve the placeholder text, I can't also use currency formatting, correct? Or am I massively missing something?


Again, you don't need to mess around with a custom Format script. It's not needed.

You just need to use the On Focus and On Blur events.

1 reply

try67
Community Expert
Community Expert
April 5, 2021

Do you mean that you want to format the value if it's not "0"?

Inspiring
April 5, 2021

I want to have a placholder that reads "$ 0" and then when text is entered, I want it to read as "$ 1,000,000"

try67
Community Expert
Community Expert
April 5, 2021

Just set the default value as "0", then, and use the built-in Number format setting... You don't need any scripts.