Re: Formatting datacard value to have decimal once out of focus
Hi @powerdevkris ,
You can do it but very messy. I also assume you want to display existing data source field values in there.
Firstly, your Text input (Classic Control example here) needs to be set as Text (not Number). Also set the DelayOutput to true
OnSelect of the Text Input
UpdateContext({varValue: Blank()})
also put this after your SubmitForm code and at Screen OnVisible
. OnChange of the Text Input
If(
IsNumeric(Self.Text),
UpdateContext(
{
varValue:
Text(
Value(Self.Text),
"###.00"
)
}
)
)
Now the Default of the Text Input
Coalesce(
varValue,
Text(
ThisItem.YourNumberField,
"###.00"
)
)
and last the Update of the Data Card
Value(YourTextInputName.Text)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps