cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
Post Prodigy
Post Prodigy

MAKE THE COMMA AUTOMATICALLY IN A INPUTTEXT

There is a way to make automatically insert a comma when the user insert the number?

 

Like:

 

If he types: 2345 the input text show: 234,50

 

Or another way to make more simple

 

Thanks for the help!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Gorilla_8 ,

If you want the  comma appears instantly, I afraid that there is no direct way to achieve your needs in PowerApps currently.

 

As an alternative solution, I think the Timer control could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Add a Timer control in your app, set the Duration property to following:

1000

set the AutoStart and Repeat property to following:

true

set the OnTimerEnd property to following:

Set(ConvertedValue, Text(Value(TextInput2.Text), "[$-en-US]###,#0"))

set the Visible property of the Timer to following:

false // hiden the Timer control

 

set the Default property of the TextInput box to following:

ConvertedValue

 

Please check the following GIF screenshot for more details:

Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Krishna92
Microsoft
Microsoft

@Gorilla_8 

 

You can try using the text function in power apps where you can specify the format type.

Here you can specify the format on how you want to display the values.

 

Please check the below documentation on more information related to Text() function.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-text#description

 

If this information helps you, please hit the like button and mark the solution as resolved, so that it will help other users in future.

First, thanks for the reply @Krishna92 

 

Second, I know about this Kris, but I wanna if it is possible do automatically before he saves the data...

 

If(DataCardValue1.Selected.Value="Reembolso Internacional";Text(Value(LineCost); "[$-pt-BR] 0,00");Text(Value(LineCost); "[$-pt-BR]R$ 0,00"))

 

 

Hi @Gorilla_8 ,

Do you want the number typed within the Text box to be converted into a proper format automatically?

 

Based on the needs that you mentioned, I think the OnChange property of the Text Input box could achieve your needs. I have made a test on my side, please take a try with the following workaround:

1.JPG

Set the OnChange property of the Text Input (LineCostTextInput) to following:

Set(ConvertedValue, Text(Value(TextInput1.Text), "[$-en-US]###,00"))

set the Default property of the TextInput1 to following:

ConvertedValue

 

When you enter a number value within above TextInput box, then move the focus out of the TextInput box, the ConvertedValue variable would be generated, and displayed within the TextInput Box.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft Thanks for the help, but its not that exactly I want to do...

 

I need that when the number is typed, a comma appears instantly

Hi @Gorilla_8 ,

If you want the  comma appears instantly, I afraid that there is no direct way to achieve your needs in PowerApps currently.

 

As an alternative solution, I think the Timer control could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Add a Timer control in your app, set the Duration property to following:

1000

set the AutoStart and Repeat property to following:

true

set the OnTimerEnd property to following:

Set(ConvertedValue, Text(Value(TextInput2.Text), "[$-en-US]###,#0"))

set the Visible property of the Timer to following:

false // hiden the Timer control

 

set the Default property of the TextInput box to following:

ConvertedValue

 

Please check the following GIF screenshot for more details:

Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-xida-msft Thanks for the reply.

 

I was almost sure that there was no "simple" way to solve this, but it already helps me a lot in my solution, thank you so much for your attention

 

You are amazing, thanks for the help

@v-xida-msft There is a problem...this solution works very well...

 

But my solution...Have to work on a collection, and didn't work...

 

Ja7
Frequent Visitor

Hi, this almost solved my input formatting issue - one question: the formatted number disappears from my datacard after the formatting is completed. How to solve this?

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (12,450)