Overview
Using a textbox to house currency data, it’s easy to display the value in currency format. If an update is made, formatting can be triggered using variables.

YouTube
Standard Formatting
On any textbox or label, you can easily set currency formatting when reading data from your data source. This is the formula that needs to be used:
Text({data field}, “[$-en-US]$#,##0.00”)
Using a comma delimiter and including 0’s where default values should appear, currency values will always appear correctly to the end user.

If you attempt to modify the value in the textbox, by default it will not format on change.

Currency Format on Updates
Introducing currency formatting on updates is easy to do and involves a couple of variables.
- Go to your textbox control
- Select the OnChange property
- Add a variable to hold the updated value and a flag identifying there has been an update
UpdateContext({amountValue: Self.Text});
UpdateContext({amountUpdate: true});

- Go to the Default property of your control
- Add the following logic to use the formatted variable instead of the value from the data source
If(amountUpdate,
Text(Value(amountValue), “[$-en-US]$#,##0.00”),
Text({data field}, “[$-en-US]$#,##0.00”)
)

Gallery OnSelect Update (Optional)
If you are switching between records, the variables should be cleared:
- Go to the gallery
- Toggle to the OnSelect property
- Update the formula to clear out the variables
UpdateContext({amountValue: Blank()});
UpdateContext({amountUpdate: false});

Final Result
Here is what the formatting changes should look like:

