question

chbernard avatar image
0 Votes"
chbernard asked RobCaplan edited

Xamarin android setting language for decimal field coma or dot ?

Hello,

we have an app in c# xamarin android
in this app, we need to add an decimal field

all works but my colleague has his device to an other settings has me.
Me i have my device in language french suisse, when i enter 10.25 and save inside sqllite and edit again its works fine.

my colleague is other language and when we enter for example -> 10,25 inside the database sql lite
when he edit this value the result is 1025 ... the amount is x 100 !

How we can solve this problem ?
any idea

thanks for all

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeonLu-MSFT avatar image
0 Votes"
LeonLu-MSFT answered

Hello,​

Welcome to our Microsoft Q&A platform!

System.Globalization.CultureInfo.CurrentCulture = new System.Globalization.CultureInfo("fr-Fr");

but i don't know if i need to add this on each activity / fragment ?

Yes, it just worked in current activity / fragment. If you want to keep the French language, you have to add in your every resumed of activities. Or you can add a base activity like this thread:
https://stackoverflow.com/a/32994325/10627299

Then other activity could extend this base activity.

Best Regards,

Leon Lu



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

chbernard avatar image
0 Votes"
chbernard answered

Hello,
i've add this on my fragment and it's seems to work ..

System.Globalization.CultureInfo.CurrentCulture = new System.Globalization.CultureInfo("fr-Fr");

but i don't know if i need to add this on each activity / fragment ?

any comment or suggestion would be appreciated

thanks

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

chbernard avatar image
0 Votes"
chbernard answered

Hello,
thanks again for your comment leon lu..

i've created a baseactivity and all activity heride from this
Seems to work

thanks for all

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.