How to get numbers to show currency and price

I hadn’t realized how limited the numeric formatting options are in CMS-bound numeric fields, so I’ve decided to add this to the WFU library as a custom attribute.

You can just add the script reference into your page’s </body> custom code area;

<script type="module" src="https://cdn.jsdelivr.net/gh/sygnaltech/webflow-util@3.21/src/nocode/webflow-format.js"></script>

And then on the element you’ve bound to your CMS number field, add a custom attribute;

wfu-format=usd

EDIT: That’s all you need to do, however note that since this is a script running, the formatting will it will only appear on your published site an not in the designer. [ Thanks, Aaron! ]

Here are the docs if you’d like to go deeper on the options;

3 Likes