Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 431995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:01:49+00:00 2026-05-12T20:01:49+00:00

I need to display an english double in arabic numerical characters for an application

  • 0

I need to display an english double in arabic numerical characters for an application I am working on.

Here is an example class that holds the double:

public class Class1
{
    private double someDouble = 0.874;

    public double SomeDouble
    {
        get { return someDouble; }
    }
}

I want to convert the value of SomeDouble to a percentage displayed in Arabic numeric characters at runtime. Here is some quick XAML I’ve been using as a test:

<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ArabicNumbers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Class="ArabicNumbers.Window1"
Title="Window1"
Height="300"
Width="300">
<Window.Resources>
    <local:Class1 x:Key="Class1Instance" />
    <local:DoubleValueConverter x:Key="doubleValueConverter" />
</Window.Resources>

<Grid DataContext="{Binding Source={StaticResource Class1Instance}}">
    <TextBlock
        HorizontalAlignment="Left"
        VerticalAlignment="Top"
        TextWrapping="Wrap"
        Margin="10"
        Text="{Binding SomeDouble, Converter={StaticResource doubleValueConverter}, Mode=Default}"/>       
</Grid>

And my test value converter, DoubleValueConverter:

public class DoubleValueConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        double valueAsDouble = (double)value;
        return valueAsDouble.ToString("P1", culture);
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

In the code behind for the window, I set the Language property to the current culture which is “ar-SA”. This would seem to be a requirement as this changes the value of the culture parameter in DoubleValueConverter.

public partial class Window1 : Window
{
    public Window1()
    {
        Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name);
        InitializeComponent();
    }
}

This converter provides the correct formatting properties, ie the decimal separator, however I need these numbers to be output as Arabic characters rather than “87,4%”.

Does anyone have any suggestions on a simple way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:01:49+00:00Added an answer on May 12, 2026 at 8:01 pm

    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.

    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)

    See these links for more information:

    http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.digitsubstitution.aspx
    http://msdn.microsoft.com/en-us/library/system.globalization.digitshapes.aspx

    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.

    To by pass this, I simply created a new CultureInfo object and changed the DigitSubstitution to DigitShapes.NativeNational:

            CultureInfo ci = CultureInfo.CreateSpecificCulture(Thread.CurrentThread.CurrentCulture.Name);
            ci.NumberFormat.DigitSubstitution = DigitShapes.NativeNational;
            Thread.CurrentThread.CurrentCulture = ci;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a Bilingual application (English and Arabic) with struts framework.
In my application i need to display arabic text with different custom fonts. I
I need to display an alert box in other than English language for which
i am developing one application with map view i need display the weather depends
I need to display an error message on rejecting a drop in my application.
I built a Lua web application and it's become clear that I need to
I'm developing a Web application. I need to display some decimal data correctly so
I'm working on an iPhone app that we're localizing in both English and Japanese
I am writing a month calendar-style control, and need to display a string that
I need to display name as dot.. ex:please help me as Please help... like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.