I am using a solution to format the text in a text input control to a currency format using a variable, like so:
Set(varCurrency,Text(RoundUp(Value(TextInput3.Text),2),"[$-en-US]$#,###.00"))
(kudos to N. Milligan for the original solution https://easypowerplatform.com/2020/08/31/format-text-as-currency-in-power-apps/).
The solution works perfectly, except I can't get it to work using the € symbol. Can someone advise how to change the string above to the € format?
Thanks!
I was on a deadline, so I ended up abandoning the idea of having a currency symbol in the box... Will keep this thread for my next currency box mishap. Thank you for your help!
I'm not clear on what you mean when you say the input is "controlled by - and sets - a variable". Is the user Typing into the TextInput box, like example 1 in the article? or typing into a TextInput box and setting a label like example 2? If its #1 then default will no longer apply after the user types something into the box and leaves the box the first time. Not until the control is Reset().
Tried, no success. The input is controlled by - and sets - a variable, so default should apply before and after the text is entered. I'll start from scratch in a new app and see if that does the trick. Thank you for helping!
I just tested it and it works for me. The one issue you might run into is that default only applies before the user enters text into a TextInput control. So if you are tweaking the formula without saving and reloading from scratch it might keep the previous value as the Text rather than reverting to the default. To see if that is what it is try adding a Reset(TextInputName) to a button on the screen and reset the button before entering text. In my testing that appears to be what is happening.
I tried to apply your string to the OnChange property of the text input but after entering the number, the box clears and remains empty...
The string works... the variable value is in the correct format (I tested it on a text label), but the text input goes blank... Maddening!
You'll need to change the [$-en-US] if you want to use the Euro marking. LIke this
Set(varCurrency,Text(RoundUp(Value(TextInput3.Text),2),"€###,##0.00"))