Good day all,
I have an interesting question. I have a Power App wherein is a form with currency values. The user can edit the currency values, and submit the form to save the data. The app is built in Dutch, where the currency format would be along the lines of "€##.###,##". However, as Power Apps does, the data is saved in the different format "##,###.##". Therefore, it is difficult for me to make it user-friendly.
The question is as follows; I want to allow the users to type in the Dutch format, with thousands separated by . or nothing at all, and cents to be separated by a comma (,). When it comes time to save to the database, I want the system to convert it to the other format, so it can be saved as it should be, without errors. Currently, I have the input still using the database format, and I display a label which shows the user the Dutch format.
I also have an automatic formula that calculates a total amount from the inputted currency values earlier. I would like to keep this included as well. In the attachments I hope you can find more clarity.
Kind regards.
UPDATE:
I seem to have figured it out. By keeping the Default values of each datacard intact, and instead using the Value property of each input control, I can substitute the decimals like so: Substitute(Text(Value(Parent.Default)), ".", ","). I can then, upon the user changing it, use UpdateContext and a variable to internally change the value back to a number with the decimal in the correct place like so: Value(Substitute(Text(Self.Value),",",".")). Now, I can do the calculation proper, and once the user wishes to save, the Update property of each datacard will look as such: Value(Substitute(DataCardValue.Value, ",", ".")). It will now properly convert the text back to the format that is acceptable for the database (Dataverse in this instance), and it will save it.
In conclusion, using the above properties, the user can type a Dutch currency value such as "125,50", and once they hit save, it will be converted to "125.50" instead, and saved.