Adding modifiers for x-text ? #1289
Chandler-Zhu
started this conversation in
3. Feature Ideas
Replies: 1 comment 1 reply
-
|
There are already a few ways to do it now. For example <script>
function formatMoney(value) {
return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' })
}
</script>
<div x-data="{subtotal:1645.98}">
<h2>
Your subtotal is <span x-text="formatMoney(subtotal || '0.00')"></span> $
</h2>
</div> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I hope in the next release there will be modifiers for
x-text, such asx-text.toLocaleString('en-US')pseudo code:
result: Your subtotal is 1,645.98 $
Beta Was this translation helpful? Give feedback.
All reactions