Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

String.Format and Region Format

$
0
0

IFormatProvider _fpUsFormatProvider = new CultureInfo("en-US").NumberFormat;
sImageFileName = String.Format(_fpUsFormatProvider, "{0}x{1}.jpg", _dDevice.HeroImageWidth, _dDevice.HeroImageHeight);

So I am trying the above with the Region Format of the device set to Swiss German. In the format line, the width and height are integers. This causes the app to crash with or without the format provider included. Other device region formats work fine (United States, Switzerland).

This seems to have started happening with 7.1.1 but am not entirely sure about that. I would like to leave the width and height properties as integers. Does anyone know how I can go about making that String.Format line work with any Region Format?

Thanks.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>