web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Problem converting dec...
Power Apps
Unanswered

Problem converting decimal separation from point to comma

(2) ShareShare
ReportReport
Posted on by 247

Hello everyone,

 

I am trying to change the decimal symbol from point to comma on an expense app.

 

I don't want to change the language settings on the browser which is on English (United States) and i tried the following:

 

Text Input field:

Default: Text(ThisItem.Lineexpamm,"#,##0.00","el-GR")

 

When i enter a value, on save, the value shifts all the digits before the comma. So if for example i enter 150,2 on save it will make it 1502,00

On patch the specific item is patched with the following expression (expamm is the name of the text input):

 

Lineexpamm:Value(Substitute(expamm.Text;".";",");"el-GR")  but i get the  following error:

 

stavrama_0-1673614476587.png

 

Can you please help me figure out the problem?

 

Thanks a lot!

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @stavrama ,

     

    The thing that is causing the errors is the use of semicolons instead of commas:

     

    Lineexpamm:Value(Substitute(expamm.Text,".",","),"el-GR")

     

    However, I think there must be an easier option to deal with this. Perhaps we can start with the Default:

    Text(ThisItem.Lineexpamm,"#,00","el-GR")

    , then the Patch part can be chagned to Value(expamm.Text)

  • mstavra Profile Picture
    247 on at

    Hello and thanks for the reply,

     

    semicolon replace with commas worked but whenever i enter a number (decimal or integer) on save the input is blank.

     

    I tried also the easier option but it get shifting the numbers without decimals...

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @stavrama ,

     

    A quick way to revert the change is to divide by 10, but let's look at a more permanent solution.

     

    For that, can you please share the data source and column details?

  • mstavra Profile Picture
    247 on at

    Hi @BCBuizer ,

     

    I thought also to divide by 10 but if i enter a higher digit this one don't work either. If i enter 150,34 it will be converted to 15034. So even if i divide it by 10 it will be changed to 1503,4 which again it is wrong!

     

    The column i enter the ammount, is part of a collection:

     

    ClearCollect(ExpenseCollection, {Linedate: "", Linecat: "", Linecattype: "", Linesupp: "", Linerecno: "", Lineexchrate: 1, Linecurtype: "", Lineexpamm: 0,Linestart: "", Lineend: "", DateID: "1",ShowSaveButtons: true})

  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @stavrama ,

     

    I played around with this a bit and what seems to work is to use this to save:

    {Lineexpamm:Value(Substitute(expamm.Text,",","."))}

    It looks like your code but has the comma and period reversed. This saves the value correctly without having the decimal point moving.

     

    To display the value according to your wishes, use:

    Text(ThisItem.Lineexpamm,"0.00","el-GR")

     

  • mstavra Profile Picture
    247 on at

    Hello,

     

    Sorry for the delay but i had to make the changes on every field on my app. 

    Everything works fine apart from a field i use when i edit the records and a filed i use for the sum of the expenses on new record.

     

    The 1st field takes the final expense amount of all the records, it subtracts the saved value of the selected  record and then  sum the new value which is a multiply of 2 fields. Expense Amount and Exchange Rate.

     

    Below is the line that is working on my app that i haven't converted point to comma:

     

     

     

    (MasterGallery.Selected.ExpenseAmmount - ThisItem.ExpensewithExchangeRate) + (ExpenseLabel*ExchrateLabel)

     

     

     

    And this is the line i use on  the app i have made the conversions:

     

     

     

    Text((MasterGallery.Selected.ExpenseAmmount-ThisItem.ExpensewithExchangeRate) + (ExpenseLabel*ExchrateLabel),"0.00","el-GR")

     

     

     

    Regarding the sum field i use the following line. The problem here is that it doesn't make the conversion from point to comma. The result is correct.

     

     

     

    Value(Substitute(Sum(ExpenseCollection,Lineexpexch),",","."))
    
    If i use Text() i get the comma correct but on save the sharepoint list shifts the numbers. So 200,55 make it 20.055.
    This field is not inside the collection so on save i only do SubmitForm(Form1)
    
    Text(Sum(ExpenseCollection,Lineexpexch),"0.00","el-GR")

     

     

  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @stavrama ,

     

    Can you please share the Update property of the data card for the field that is not working? I think you'll need to change that to include the Substitute function.

  • mstavra Profile Picture
    247 on at

    @BCBuizer 

     

    The sum field was needed indeed to add Value(Substitute(DataCardValue13.Text,",",".")) on update. Thanks, i would never have thought that :).

     

    Now we only have to solve the 1st problem and we are done 🙂

  • mstavra Profile Picture
    247 on at

    I have 2 sharepoint lists. The first one is pht-master which is stored the total expense amount. The 2nd one is pht-child where all the expense rows are stored and the fields we need there are expenseamount, exchange rate, expenseamount with exchange rate and a custom card where i do the calculation:

     

    stavrama_2-1674048910671.png

     

    Exchange Rate: 
    
    label:
    
    Text: ThisItem.ExchangeRate
    
    Datacard:
    
    Update: Value(ExchrateLabel.Text)
    
    
    
    Expense Amount:
    
    Label:
    
    Text: ThisItem.ExpenseAmount
    
    Datacard:
    
    Update: Value(ExpenseLabel.Text)
    
    
    
    ExpenseςwithExchangeRate:
    
    Label:
    
    Text: ThisItem.ExpensewithExchangeRate
    
    Datacard:
    
    Update: Value(expexchlabel.Text)
    
    
    
    Custom Card for Calculation:
    
    Label:
    
    Text: (MasterGallery.Selected.ExpenseAmmount - ThisItem.ExpensewithExchangeRate) + (ExpenseLabel*ExchrateLabel)

     

    The above settings work fine. When i make all the changes for the decimal switch, the custom card calculation is wrong. 

     

    Exchange Rate: 
    
    label:
    
    Text: Text(ThisItem.ExchangeRate,"0.00","el-GR")
    
    Datacard:
    
    Update: Value(Substitute(ExchrateLabel.Text,",","."))
    
    
    
    Expense Amount:
    
    Label:
    
    Text: Text(ThisItem.ExpenseAmmount,"0.00","el-GR")
    
    Datacard:
    
    Update: Value(Substitute(ExpenseLabel.Text,",","."))
    
    
    
    ExpenseςwithExchangeRate:
    
    Label:
    
    Text: Text(ThisItem.ExpensewithExchangeRate,"0.00","el-GR")
    
    Datacard:
    
    Update: Value(Substitute(expexchlabel.Text,",","."))
    
    
    
    Custom Card for Calculation:
    
    Label:
    
    Text: Text((MasterGallery.Selected.ExpenseAmmount-ThisItem.ExpensewithExchangeRate) + (ExpenseLabel*ExchrateLabel),"0.00","el-GR")

     

    stavrama_3-1674049298469.png

     

    On save i patch the results with the following line:

     

    Patch('phtexp-master',MasterGallery.Selected, {ExpenseAmmount: Value(Substitute(ExpenseChange.Text,",","."))});Patch('phtexp-child',ChildForm.LastSubmit,{ExpensewithExchangeRate: Value(Substitute(ExpenseLabel.Text*ExchrateLabel.Text,",","."))})

     

    Sorry for the long post!

     

  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @stavrama,

     

    In this context, when referencing a label, it will take the text from that label and convert it to a number. Because the text contains a comma instead of a decimal point, the type conversion will ignore it, so you have to apply the substitute from comma to decimal point before the type conversion:

     

    Custom Card for Calculation:
    
    Label:
    
    Text: Text((MasterGallery.Selected.ExpenseAmmount-ThisItem.ExpensewithExchangeRate) + (Substitute(ExpenseLabel,",",".")*Substitute(ExchrateLabel,",",".")),"0.00","el-GR")

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard