cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MikaelJ
Frequent Visitor

Handling language and numbers

Hi,

 

I have a list imported from SP in a Collection. The list comes directly one of our suppliers and can basically not be changed unless I do the job myself which is tedious work. List includes columns with "Text as numbers" by US standards (1.1, 2.2, 3.3 etc.).

 

This works well when working from a machine with English as the Windows language. Same goes for when running the app on the same computer. 

 

The problem occurs when my colleagues, who are running Norwegian as their Windows language, tries to run the app. All decimal numbers from the collection now returns 'Blank' instead of 1,1 ; 2,2 ; 3,3 (Scandinavians use comma instead of dot when separating decimals).

 

Is there any way of forcing the App to run with a certain language to avoid this problem? If not, any suggestion on how to update the collections based on the language?

 

I am looking for something like the below but that can be run over a whole Collection if the language isn't set to en-US.

 

If (IsMatch(Language(), "nb-NO"),

Substitute(MyText, ".", ",")

)

 

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User
Super User

@MikaelJ 

I am not entirely clear what you mean by "over the entire collection".  In general, you don't want to change the values of a datasource to match a language or display.  That would be mixing user-interface into your data layer.

 

The format of numbers is governed by the language of the device running the app.  So, when you display a decimal based number, PowerApps will already display as needed for the local language.

 

I believe your issue is more that your numbers are in Text form as you show a substitute function against the value you want to change.

So, the key in your display of the numbers is to display as a number instead.

i.e.  Value(MyText)

Will convert to a number and then display with the regional language.

 

Also, you can force a language on a number using the Text function.

So - Text(12.34, "#.0#", "NB-no")  will display 12,34

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Good morning,

 

So I found a solution for this without changing the lists in SP. The reason why I am reluctant to change the list

is when these should be updated later on. We receive new list at least once a year and I'm not planning on managing that every time.

 

What @RandyHayes mentioned about having strings that are actually numbers is the main source of the problem here. I would say that the "language barrier" in PowerApps also makes things more complicated, especially when developing for a multilingual team. 

 

My solution here was to create a Component with a function that "translates" the numbers into the correct language. This morning I've tried three different languages and all of them are giving me the same results.

 

Thumbs up for @RandyHayes that lead me in the right direction. 

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@MikaelJ 

I am not entirely clear what you mean by "over the entire collection".  In general, you don't want to change the values of a datasource to match a language or display.  That would be mixing user-interface into your data layer.

 

The format of numbers is governed by the language of the device running the app.  So, when you display a decimal based number, PowerApps will already display as needed for the local language.

 

I believe your issue is more that your numbers are in Text form as you show a substitute function against the value you want to change.

So, the key in your display of the numbers is to display as a number instead.

i.e.  Value(MyText)

Will convert to a number and then display with the regional language.

 

Also, you can force a language on a number using the Text function.

So - Text(12.34, "#.0#", "NB-no")  will display 12,34

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Good morning,

 

So I found a solution for this without changing the lists in SP. The reason why I am reluctant to change the list

is when these should be updated later on. We receive new list at least once a year and I'm not planning on managing that every time.

 

What @RandyHayes mentioned about having strings that are actually numbers is the main source of the problem here. I would say that the "language barrier" in PowerApps also makes things more complicated, especially when developing for a multilingual team. 

 

My solution here was to create a Component with a function that "translates" the numbers into the correct language. This morning I've tried three different languages and all of them are giving me the same results.

 

Thumbs up for @RandyHayes that lead me in the right direction. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,135)