cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jdelacrettaz
Advocate I
Advocate I

How to save decimal to a table dbo?

I have this function:

Patch('[dbo].[articulosXpres]'; Defaults('[dbo].[articulosXpres]'); {desc:DataCardValue14.Text};{id_art:BrowseGallery2.Selected.num_art};{premillar:Value(TextInput4.Text)};{cant_art:Value(TextInput2.Text)};{id_pres: BrowseGallery1.Selected.n_presu});;Navigate(listar_articulo; ScreenTransition.Fade)

 

When I want to save it to the database it shows me an error saying:

Sin título.png

This error is because premillar is decimal and does not take numbers with a comma. How can I do to be able to save it with the price that appears in image in my table dbo?


PD: The whole patch function works well less premillar than I do not pass the corresponding value

 

 

Sin título.png

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi jdelacrettaz,

 

I assume you could use Text function to format the decimal number as Text(Decimal,"[$-en-US]$###,##").


About Text function, please see this documentation for a reference:
https://powerapps.microsoft.com/en-us/tutorials/function-text/

 

To test this issue, I create an app looks like below. The Patch function I am using is:

Patch('[dbo].[a2]',Defaults('[dbo].[a2]'),{id:Value(TextInput1.Text),name:TextInput2.Text,Decimal:Value(TextInput3.Text)})

3.PNG

 

Then on the Gallery screen, configure the Text property for the Decimal column as: Text(Decimal,"[$-en-US]$###,##")
Then the value patched by the button will be shown as “$14,623” on the Gallery screen. Looks like below:

4.PNG

 

Hope it could be a reference for you. Please feel free reply if you need more help.

 

Best regards,
Mabel Mao

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

Thanks for the answer, but it does not help me, since what I want to save is the number 712,14 in the column premillar and does not leave me for the error that throws me, if I keep it as 712.14 lets me save it, but in the column Premillar guard me 71214 and when I show it in the browsgallery I can not make it show me 712.14. How can I fix it?

What I have to show is a price and it is important that I show 714,14 since after that a sum of everything is done and shows the final price.

I hope someone can help me solve this problem

thanks you!!

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,942)