Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've found a very quick and easy solution to this. I discovered that the use of arabic characters for numbers was contextual; ie the digit shape depends on the previous text in the same output.</p> <p>Example: Entering "1234" as the text in a TextBlock element would simply display this in the english shape. However, if 1234 was preceded with some arabic text (let's say "abcde") such as شلاؤيث1234. In this example, then first four digits would be in the arabic shapes for the characters "1234". (Note: this doesn't seem to work in for this website - displays correctly in the text box however the preview shows english shapes for the numbers)</p> <p>See these links for more information:</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.digitsubstitution.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.digitsubstitution.aspx</a> <a href="http://msdn.microsoft.com/en-us/library/system.globalization.digitshapes.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.globalization.digitshapes.aspx</a></p> <p>From looking at the second link, the obvious choice I wanted was NativeNational, however since our CurrentCulture is set automatically by the operating system, the CurrentCulture instance is read only.</p> <p>To by pass this, I simply created a new CultureInfo object and changed the DigitSubstitution to DigitShapes.NativeNational:</p> <pre><code> CultureInfo ci = CultureInfo.CreateSpecificCulture(Thread.CurrentThread.CurrentCulture.Name); ci.NumberFormat.DigitSubstitution = DigitShapes.NativeNational; Thread.CurrentThread.CurrentCulture = ci; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload